Struct persist::client::RuntimeClient [−][src]
pub struct RuntimeClient {
sender: RuntimeCmdSender,
stopper: Arc<StopRuntimeOnDrop>,
}
Expand description
A clone-able handle to the persistence runtime.
The runtime is stopped when any client calls RuntimeClient::stop or when all clients have been dropped, whichever comes first.
NB: The methods below are executed concurrently. For a some call X to be guaranteed as “previous” to another call Y, X’s future must have been received before Y’s call started (though X’s future doesn’t need to have resolved).
Fields
sender: RuntimeCmdSender
stopper: Arc<StopRuntimeOnDrop>
Implementations
pub(crate) fn new(
handle: RuntimeHandle,
tx: Sender<RuntimeCmd>,
metrics: Arc<Metrics>
) -> Self
pub fn create_or_load<K: Codec, V: Codec>(
&self,
name: &str
) -> (StreamWriteHandle<K, V>, StreamReadHandle<K, V>)
pub fn create_or_load<K: Codec, V: Codec>(
&self,
name: &str
) -> (StreamWriteHandle<K, V>, StreamReadHandle<K, V>)
Synchronously registers a new stream for writes and reads.
This method is idempotent. Returns read and write handles used to construct a persisted stream operator.
TODO: This description seems outdated? Or at least only half true. If data was written by a previous RuntimeClient for this id, it’s loaded and replayed into the stream once constructed.
Returns a Description of the stream identified by id_str
.
Synchronously closes the runtime, releasing exclusive-writer locks and causing all future commands to error.
This method is idempotent.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RuntimeClient
impl Send for RuntimeClient
impl Sync for RuntimeClient
impl Unpin for RuntimeClient
impl UnwindSafe for RuntimeClient
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more