Trait phron_finality::network::session::SessionManager
source · pub trait SessionManager<D: Data>: Send + Sync + 'static {
type Error: Display;
// Required methods
fn start_nonvalidator_session(
&self,
session_id: SessionId,
verifier: AuthorityVerifier
) -> Result<(), Self::Error>;
fn start_validator_session<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
verifier: AuthorityVerifier,
node_id: NodeIndex,
pen: AuthorityPen
) -> Pin<Box<dyn Future<Output = Result<SimpleNetwork<D, UnboundedReceiver<D>, SessionSender<D>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn early_start_validator_session(
&self,
session_id: SessionId,
verifier: AuthorityVerifier,
node_id: NodeIndex,
pen: AuthorityPen
) -> Result<(), Self::Error>;
fn stop_session(&self, session_id: SessionId) -> Result<(), Self::Error>;
}
Expand description
An interface for managing session networks for validators and nonvalidators.
Required Associated Types§
Required Methods§
sourcefn start_nonvalidator_session(
&self,
session_id: SessionId,
verifier: AuthorityVerifier
) -> Result<(), Self::Error>
fn start_nonvalidator_session( &self, session_id: SessionId, verifier: AuthorityVerifier ) -> Result<(), Self::Error>
Start participating or update the verifier in the given session where you are not a validator.
sourcefn start_validator_session<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
verifier: AuthorityVerifier,
node_id: NodeIndex,
pen: AuthorityPen
) -> Pin<Box<dyn Future<Output = Result<SimpleNetwork<D, UnboundedReceiver<D>, SessionSender<D>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_validator_session<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
verifier: AuthorityVerifier,
node_id: NodeIndex,
pen: AuthorityPen
) -> Pin<Box<dyn Future<Output = Result<SimpleNetwork<D, UnboundedReceiver<D>, SessionSender<D>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start participating or update the information about the given session where you are a validator. Returns a session network to be used for sending and receiving data within the session.
sourcefn early_start_validator_session(
&self,
session_id: SessionId,
verifier: AuthorityVerifier,
node_id: NodeIndex,
pen: AuthorityPen
) -> Result<(), Self::Error>
fn early_start_validator_session( &self, session_id: SessionId, verifier: AuthorityVerifier, node_id: NodeIndex, pen: AuthorityPen ) -> Result<(), Self::Error>
Start participating or update the information about the given session where you are a validator. Used for early starts when you don’t yet need the returned network, but would like to start discovery.