pub struct Stream { /* private fields */ }
Expand description

Ockam stream protocol controller

Each stream has a sending and consuming worker (publisher and consumer) that are created and managed on the fly by this abstraction.

Implementations

Create a new Ockam stream controller

By default, the created stream will poll for new messages every 250 milliseconds.

Customize the polling interval for the stream consumer

Specify the stream service running on the remote

Specify the index service running on the remote

Specify the client_id for the stream consumer

When setting up a stream without calling this function a random client id will be assigned.

Specify an address to forward incoming messages to

When setting up a stream without calling this function messages will be buffered by the StreamConsumer and must be polled via the StreamWorkerCmd.

Connect to a bi-directional stream by remote and stream pair

When using the stream protocol for bi-directional communication a sending and receiving stream name is required. These two identifiers MUST be known between nodes that wish to exchange messages.

The route parameter is the route to a remote which hosts a stream_service and stream_index_service, such as hub.ockam.io.

Streams that do not already exists will be created, and existing stream identifiers will automatically be re-used.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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