Enum ractor_cluster::node::NodeServerMessage
source · pub enum NodeServerMessage {
ConnectionOpened {
stream: TcpStream,
is_server: bool,
},
CheckSession {
peer_name: NameMessage,
reply: RpcReplyPort<SessionCheckReply>,
},
UpdateSession {
actor_id: ActorId,
name: NameMessage,
},
GetSessions(RpcReplyPort<HashMap<NodeId, ActorRef<NodeSession>>>),
}Expand description
Messages to/from the session manager
Variants§
ConnectionOpened
Fields
Notifies the session manager that a new incoming (is_server = true) or outgoing (is_server = false)
TcpStream was accepted
CheckSession
Fields
§
peer_name: NameMessageThe peer’s name to investigate
§
reply: RpcReplyPort<SessionCheckReply>Reply channel for RPC
A request to check if a session is currently open, and if it is is the ordering such that we should reject the incoming request
i.e. if A is connected to B and A.name > B.name, but then B connects to A, B’s request to connect to A should be rejected
UpdateSession
Fields
§
actor_id: ActorIdThe ID of the NodeSession actor
§
name: NameMessageThe node’s name (now that we’ve received it)
A request to update the session mapping with this now known node’s name
GetSessions(RpcReplyPort<HashMap<NodeId, ActorRef<NodeSession>>>)
Retrieve the current status of the node server, listing the node sessions
Trait Implementations§
source§impl Message for NodeServerMessage
impl Message for NodeServerMessage
source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage
source§fn serializable() -> bool
fn serializable() -> bool
Determines if this type is serializable
source§fn serialize(self) -> Result<SerializedMessage, BoxedDowncastErr>
fn serialize(self) -> Result<SerializedMessage, BoxedDowncastErr>
Serializes this message (if supported)
source§fn deserialize(bytes: SerializedMessage) -> Result<Self, BoxedDowncastErr>
fn deserialize(bytes: SerializedMessage) -> Result<Self, BoxedDowncastErr>
Deserialize binary data to this message type