pub struct Scheduler {
local_pid: Pid,
local_secret: u128,
closed: AtomicBool,
run_channels: Option<ControlChannels>,
participant_channels: Arc<Mutex<Option<ParticipantChannels>>>,
participants: Arc<Mutex<HashMap<Pid, ParticipantInfo>>>,
channel_ids: Arc<AtomicU64>,
channel_listener: Mutex<HashMap<ProtocolInfo, Sender<()>>>,
metrics: Arc<NetworkMetrics>,
protocol_metrics: Arc<ProtocolMetrics>,
}Fields§
§local_pid: Pid§local_secret: u128§closed: AtomicBool§run_channels: Option<ControlChannels>§participant_channels: Arc<Mutex<Option<ParticipantChannels>>>§participants: Arc<Mutex<HashMap<Pid, ParticipantInfo>>>§channel_ids: Arc<AtomicU64>§channel_listener: Mutex<HashMap<ProtocolInfo, Sender<()>>>§metrics: Arc<NetworkMetrics>§protocol_metrics: Arc<ProtocolMetrics>Implementations§
Source§impl Scheduler
impl Scheduler
pub fn new( local_pid: Pid, registry: Option<&Registry>, ) -> (Self, UnboundedSender<(ListenAddr, Sender<Result<()>>)>, UnboundedSender<(ConnectAddr, Sender<Result<Participant, NetworkConnectError>>)>, UnboundedReceiver<Participant>, Sender<()>)
pub async fn run(self)
async fn listen_mgr( &self, a2s_listen_r: UnboundedReceiver<(ListenAddr, Sender<Result<()>>)>, )
async fn connect_mgr( &self, a2s_connect_r: UnboundedReceiver<(ConnectAddr, Sender<Result<Participant, NetworkConnectError>>)>, )
async fn disconnect_mgr( &self, a2s_disconnect_r: UnboundedReceiver<(Pid, (Duration, Sender<Result<(), ParticipantError>>))>, )
async fn prio_adj_mgr( &self, b2s_prio_statistic_r: UnboundedReceiver<(Pid, u64, u64)>, )
async fn scheduler_shutdown_mgr(&self, a2s_scheduler_shutdown_r: Receiver<()>)
async fn init_protocol( &self, protocol: Protocols, con_addr: ConnectAddr, cid: Cid, s2a_return_pid_s: Option<Sender<Result<Participant, NetworkConnectError>>>, send_handshake: bool, )
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Scheduler
impl !RefUnwindSafe for Scheduler
impl Send for Scheduler
impl Sync for Scheduler
impl Unpin for Scheduler
impl !UnwindSafe for Scheduler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more