The gemstone.client module

The gemstone.client.RemoteService class

class gemstone.client.RemoteService(service_endpoint, *, authentication_method=None)[source]
call_method(method_name_or_object, params=None)[source]

Calls the method_name method from the given service and returns a gemstone.client.structs.Result instance.

Parameters:
  • method_name_or_object – The name of te called method or a MethodCall instance
  • params – A list of dict representing the parameters for the request
Returns:

a gemstone.client.structs.Result instance.

call_method_async(method_name_or_object, params=None)[source]

Calls the method_name method from the given service asynchronously and returns a gemstone.client.structs.AsyncMethodCall instance.

Parameters:
  • method_name_or_object – The name of te called method or a MethodCall instance
  • params – A list of dict representing the parameters for the request
Returns:

a gemstone.client.structs.AsyncMethodCall instance.

handle_single_request(request_object)[source]

Handles a single request object and returns the raw response

Parameters:request_object
notify(method_name_or_object, params=None)[source]

Sends a notification to the service by calling the method_name method with the params parameters. Does not wait for a response, even if the response triggers an error.

Parameters:
  • method_name_or_object – the name of the method to be called or a Notification instance
  • params – a list of dict representing the parameters for the call
Returns:

None

Various structures

class gemstone.client.AsyncMethodCall(req_obj, async_resp_object)[source]
result(wait=False)[source]

Gets the result of the method call. If the call was successful, return the result, otherwise, reraise the exception.

Parameters:wait – Block until the result is available, or just get the result.
Raises:RuntimeError when called and the result is not yet available.
class gemstone.client.MethodCall(method_name, params=None, id=None)[source]
class gemstone.client.Notification(method_name, params=None, id=None)[source]
class gemstone.client.Result(result, error, id, method_call)[source]
class gemstone.client.BatchResult(*responses)[source]