Client bindings

class isc.client.Client(host='amqp://guest:guest@127.0.0.1:5672/', exchange='isc', codec=None, connect_timeout=2, reconnect_timeout=3, invoke_timeout=20)[source]

Represents a single low-level connection to the ISC messaging broker. Thread-safe.

force_json()[source]

Force to use JSON codec only.

invoke(service, method, *args, **kwargs)[source]

Call a remote method and wait for a result. Blocks until a result is ready.

invoke_async(service, method, *args, **kwargs)[source]

Serialize & publish method call request.

notify(event, data)[source]

Serialize & publish notification.

set_codec(codec)[source]

Set codec.

set_invoke_timeout(timeout)[source]

Sets timeout for waiting for results on this client.

set_logging_level(level)[source]

Set logging level.

start()[source]

Start connection & publisher threads.

stop()[source]

Stops the client and waits for its termination.

class isc.client.ConsumerThread(hostname, exchange_name, connect_timeout, reconnect_timeout, codec)[source]

Internal class. Represents connection & message consuming thread.

class isc.client.FutureResult(cannonical_name, **extra)[source]

Encapsulates future result. Provides interface to block until future data is ready. Thread-safe.

is_ready()[source]

Checks if this result has been resolved or rejected.

reject(exception)[source]

Rejects this promise with exception and sets “ready” event.

resolve(value)[source]

Resolves this promise with result and sets “ready” event.

wait(timeout=5)[source]

Blocks until data is ready.

class isc.client.MethodProxy(client, service_name, method_name)[source]

Convenience wrapper for method.

It allows you to perform attribute chaining (e. g. client.example.add(2, 3))

call_async(*args, **kwargs)[source]

Finalizes the chain & performs actual RPC invocation. Does not block.

Returns FutureResult.

This is same as calling invoke_async()

class isc.client.PublisherThread(consumer)[source]

Internal class. Represents message publishing thread.

class isc.client.QueuedInvocation(codec, service, method, args, kwargs)[source]

Internal class. Represents pending outgoing method call.

class isc.client.QueuedNotification(codec, event, data)[source]

Internal class. Represents pending outgoing notification.

class isc.client.QueuedRequest(codec, **kwargs)[source]

Internal class. Represents pending outgoing message.

class isc.client.ServiceProxy(client, service_name)[source]

Convenience wrapper for service.

It allows you to perform attribute chaining (e. g. client.example.add(2, 3))