proxystore.store.dim.zmq
ZeroMQ implementation.
ZeroMQStoreKey ¶
Bases: NamedTuple
Key to objects in a ZeroMQStore.
ZeroMQStore ¶
ZeroMQStore(
name: str,
*,
interface: str,
port: int,
max_size: int = MAX_SIZE_DEFAULT,
cache_size: int = 16,
stats: bool = False
) -> None
Bases: Store[ZeroMQStoreKey]
Distributed in-memory store using Zero MQ.
This client will initialize a local ZeroMQ server (Peer service) that it will store data to.
Parameters:
-
name
(
str
) –Name of the store instance.
-
interface
(
str
) –The network interface to use.
-
port
(
int
) –The desired port for communication.
-
max_size
(
int
) –The maximum size to be communicated via zmq.
-
cache_size
(
int
) –Size of LRU cache (in # of objects). If 0, the cache is disabled. The cache is local to the Python process.
-
stats
(
bool
) –Collect stats on store operations.
Source code in proxystore/store/dim/zmq.py
handler
async
¶
ZeroMQ handler function implementation.
Parameters:
-
event
(
bytes
) –A pickled dictionary consisting of the data, its key, and the operation to perform on the data.
-
addr
(
str
) –The address of the server to connect to.
Returns:
-
bytes
–The serialized result of the operation on the data.
Source code in proxystore/store/dim/zmq.py
close ¶
Terminate Peer server process.
Source code in proxystore/store/dim/zmq.py
ZeroMQServer ¶
ZeroMQServer implementation.
Parameters:
-
host
(
str
) –IP address of the location to start the server.
-
port
(
int
) –The port to initiate communication on.
-
max_size
(
int
) –The maximum size allowed for zmq communication.
Source code in proxystore/store/dim/zmq.py
set ¶
Obtain and store locally data from client.
Parameters:
Returns:
-
Status
–Operation status.
Source code in proxystore/store/dim/zmq.py
get ¶
Return data at a given key back to the client.
Parameters:
-
key
(
str
) –The object key.
Returns:
Source code in proxystore/store/dim/zmq.py
evict ¶
exists ¶
handler
async
¶
Handle zmq connection requests.
Source code in proxystore/store/dim/zmq.py
launch
async
¶
Launch the server.
Source code in proxystore/store/dim/zmq.py
wait_for_server
async
¶
Wait until the ZeroMQServer responds.
Parameters:
-
host
(
str
) –The host of the server to ping.
-
port
(
int
) –The port of the server to ping.
-
timeout
(
float
) –The max time in seconds to wait for server response.
Raises:
-
RuntimeError
–if the server does not respond within the timeout.