proxystore.store.utils¶
Store utilities.
get_key
¶
get_key(proxy: Proxy[T]) -> ConnectorKeyT
Extract the key from the proxy's factory.
Parameters:
-
proxy
(Proxy[T]
) –Proxy instance to get key from.
Returns:
-
ConnectorKeyT
–The key, a NamedTuple unique to the
Store
that created the proxy..
Raises:
-
ProxyStoreFactoryError
–If the proxy's factory is not an instance of
StoreFactory
.
Source code in proxystore/store/utils.py
resolve_async
¶
resolve_async(proxy: Proxy[T]) -> None
Begin resolving proxy asynchronously.
Useful if the user knows a proxy will be needed soon and wants to resolve the proxy concurrently with other computation.
from proxystore.store.utils import resolve_async
resolve_async(my_proxy)
computation_without_proxy(...)
# p is hopefully resolved
computation_with_proxy(my_proxy, ...)
Note
The asynchronous resolving functionality is implemented
by StoreFactory
. Factories that
are not of this type will error when used with this function.
Parameters:
-
proxy
(Proxy[T]
) –Proxy instance to begin asynchronously resolving.
Raises:
-
ProxyStoreFactoryError
–If the proxy's factory is not an instance of
StoreFactory
.