pub trait NodeEventSubscription: Send + 'static {
// Required methods
fn node_session_opened(&self, ses: NodeServerSessionInformation);
fn node_session_disconnected(&self, ses: NodeServerSessionInformation);
fn node_session_authenicated(&self, ses: NodeServerSessionInformation);
// Provided method
fn node_session_ready(&self, ses: NodeServerSessionInformation) { ... }
}
Expand description
Trait which is utilized to receive Node events (node session startup, shutdown, etc).
Node events can be used to try and reconnect node sessions or handle custom shutdown logic as needed. They methods are synchronous because ideally they’d be message sends and we don’t want to risk blocking the NodeServer’s logic
Required Methods§
Sourcefn node_session_opened(&self, ses: NodeServerSessionInformation)
fn node_session_opened(&self, ses: NodeServerSessionInformation)
A node session has started up
ses
: The NodeServerSessionInformation representing the current state of the node session
Sourcefn node_session_disconnected(&self, ses: NodeServerSessionInformation)
fn node_session_disconnected(&self, ses: NodeServerSessionInformation)
A node session has shutdown
ses
: The NodeServerSessionInformation representing the current state of the node session
Sourcefn node_session_authenicated(&self, ses: NodeServerSessionInformation)
fn node_session_authenicated(&self, ses: NodeServerSessionInformation)
A node session authenticated
ses
: The NodeServerSessionInformation representing the current state of the node session
Provided Methods§
Sourcefn node_session_ready(&self, ses: NodeServerSessionInformation)
fn node_session_ready(&self, ses: NodeServerSessionInformation)
A node session is ready
ses
: The NodeServerSessionInformation representing the current state of the node session