1.1.6. utils.zmq package

1.1.6.1. Submodules

1.1.6.2. radical.utils.zmq.bridge module

class radical.utils.zmq.bridge.Bridge(cfg)[source]

Bases: object

A bridge can be configured to have a finite lifetime: when no messages are received in timeout seconds, the bridge process will terminate.

property addr_in
property addr_out
property alive
property channel
static create(cfg)[source]
static get_config(name, pwd=None)[source]
property name
start()[source]
stop()[source]
property type_in
property type_out
property uid
write_config(fname=None)[source]

1.1.6.3. radical.utils.zmq.client module

class radical.utils.zmq.client.Client(server: Optional[str] = None, url: Optional[str] = None)[source]

Bases: object

close() None[source]
request(cmd: str, *args: Any, **kwargs: Any) Any[source]
property url: str

1.1.6.4. radical.utils.zmq.pubsub module

class radical.utils.zmq.pubsub.PubSub(cfg=None, channel=None)[source]

Bases: Bridge

property addr_in
property addr_out
property addr_pub
property addr_sub
property type_in
property type_out
class radical.utils.zmq.pubsub.Publisher(channel, url=None, log=None, prof=None, path=None)[source]

Bases: object

property channel
property name
put(topic, msg)[source]
property uid
property url
class radical.utils.zmq.pubsub.Subscriber(channel, url=None, topic=None, cb=None, log=None, prof=None, path=None)[source]

Bases: object

property channel
get()[source]
get_nowait(timeout=None)[source]
property name
stop()[source]
subscribe(topic, cb=None, lock=None)[source]
property uid
unsubscribe(cb)[source]
property url

1.1.6.5. radical.utils.zmq.queue module

class radical.utils.zmq.queue.Getter(channel, url=None, cb=None, log=None, prof=None, path=None)[source]

Bases: object

property channel
get(qname=None)[source]
get_nowait(qname=None, timeout=None)[source]
property name
stop()[source]
subscribe(cb, lock=None)[source]
property uid
unsubscribe(cb)[source]
class radical.utils.zmq.queue.Putter(channel, url=None, log=None, prof=None, path=None)[source]

Bases: object

property channel
property name
put(msgs, qname=None)[source]
property uid
class radical.utils.zmq.queue.Queue(cfg=None, channel=None)[source]

Bases: Bridge

property addr_get
property addr_in
property addr_out
property addr_put
stop()[source]
property type_in
property type_out

1.1.6.6. radical.utils.zmq.registry module

class radical.utils.zmq.registry.Registry(url: Optional[str] = None, uid: Optional[str] = None, persistent: bool = False)[source]

Bases: Server

The ru.zmq.Registry is a ZMQ service which provides a hierarchical persistent data store.

delitem(key: str) None[source]
get(key: str) Optional[str][source]
keys() List[str][source]
put(key: str, val: Any) None[source]
stop() None[source]
class radical.utils.zmq.registry.RegistryClient(url: str)[source]

Bases: Client, DictMixin

The ru.zmq.RegistryClient class provides a simple dict-like interface to a remote ru.zmq.Registry service. Note that only top-level dict-actions on the RegistryClient instance are synced with the remote service storage.

get(k[, d]) D[k] if k in D, else d.  d defaults to None.[source]
keys() a set-like object providing a view on D's keys[source]
put(key: str, val: Any) None[source]

1.1.6.7. radical.utils.zmq.server module

class radical.utils.zmq.server.Server(url: Optional[str] = None, uid: Optional[str] = None, path: Optional[str] = None)[source]

Bases: object

property addr: Optional[str]
register_request(req, cb) None[source]
start() None[source]
stop() None[source]
property uid: str
wait() None[source]

1.1.6.8. radical.utils.zmq.utils module

radical.utils.zmq.utils.get_channel_url(ep_type, channel=None, url=None)[source]

For the given endpoint type, ensure that both channel name and endpoint URL are known. If they are not, raise a ValueError exception.

For a given URL, the channel is derived as path element of that URL (leading / is stripped).

For a given channel channel name, the URL is searched in the process environment (under uppercase version of <CHANNEL>_<EPTYPE>_URL). If not found, the method will look if a config file with the name <channel>.cfg exists, and if it has a top level entry named <ep_type> (lower case).

Before returning the given or derived channel and url, the method will check if both data match (i.e. if the channel name is reflected in the URL)

radical.utils.zmq.utils.get_uids(msgs)[source]
radical.utils.zmq.utils.log_bulk(log, token, msgs)[source]
radical.utils.zmq.utils.no_intr(f, *args, **kwargs)[source]
radical.utils.zmq.utils.prof_bulk(prof, event, msgs, msg=None)[source]
radical.utils.zmq.utils.sock_connect(sock, url, hop=None)[source]

1.1.6.9. Module contents