Skip to main content

Crate msg_socket

Crate msg_socket 

Source
Expand description

§MSG Sockets

This crate exposes a set of socket types that can be used to facilitate multiple communication patterns, such as:

  • Request-Reply
  • Publish-Subscribe

Sockets are the main entrypoint in this library and facilitate all connectivity, like binding or connecting, and sending and receiving messages over connections.

Re-exports§

pub use hooks::ConnectionHook;
pub use hooks::Error as HookError;
pub use hooks::HookResult;

Modules§

backoff
hooks
Connection hooks for customizing connection establishment.
state
stats

Structs§

ConnOptions
Options for the connection manager.
ExponentialBackoff
A stream that yields exponentially increasing backoff durations.
PubMessage
A message received from a publisher. Includes the source, topic, and payload.
PubOptions
PubSocket
A publisher socket. This is thread-safe and can be cloned.
RepOptions
The reply socket options.
RepSocket
A reply socket. This socket implements Stream and yields incoming Requests.
ReqMessage
A message sent from a ReqSocket to the backend task.
ReqOptions
The request socket options.
ReqSocket
The request socket.
Request
A request received by the socket.
RequestId
A request Identifier.
SendCommand
A command to send a request message and wait for a response.
SubOptions
SubSocket
A subscriber socket. This socket implements Stream and yields incoming PubMessages.

Enums§

ConnectionState
Abstraction to represent the state of a connection.
Profile
The performance profile to tune socket options for.
PubError
Errors that can occur when using a publisher socket.
RepError
Errors that can occur when using a reply socket.
ReqError
Errors that can occur when using a request socket.
SubError
Errors that can occur when using a subscriber socket.

Constants§

DEFAULT_BUFFER_SIZE
The default buffer size for a socket.
DEFAULT_QUEUE_SIZE
The default queue size for a channel.

Traits§

Backoff
Helper trait alias for backoff streams. We define any stream that yields Durations as a backoff