pub enum ManagerTask {
Show 19 variants
Direct(DirectTask),
Accept {
stream: RelayStream,
peer_addr: SocketAddr,
},
Register {
key: ImutableKey,
conn_id: RemoteConnId,
need_codec: bool,
is_datagram: bool,
protocol_version: u16,
conn_sender: SenderChan<ConnTask>,
retire_token: CancellationToken,
direct: Option<AuthContext>,
},
ServerConnActivity {
key: ImutableKey,
conn_id: RemoteConnId,
},
Subcribe {
key: ImutableKey,
conn_id: RemoteConnId,
conn_sender: SenderChan<ConnTask>,
excluded_server_conns: Vec<(RemoteConnId, u64)>,
selected: Option<(RemoteConnId, u64)>,
},
Stream {
data_protocol: Option<u16>,
key: ImutableKey,
stream: RelayStream,
session: ServerHeaderSession,
server: ConnLease,
client_id: RemoteConnId,
server_generation: u64,
},
StreamAck {
server_id: RemoteConnId,
client_id: RemoteConnId,
server_generation: u64,
},
Status {
response_sender: Sender<PbConnResponse>,
status: PbConnStatusReq,
namespace: u64,
conn_id: RemoteConnId,
},
StatusQuery {
response_sender: Sender<ServerStatusInfo>,
},
AdminServiceList {
key_id: Option<u64>,
page: u32,
page_size: u16,
response_sender: Sender<AdminServicePage>,
},
AdminConnectionList {
key_id: Option<u64>,
page: u32,
page_size: u16,
response_sender: Sender<AdminConnectionPage>,
},
AdminConnectionRetire {
key: ImutableKey,
conn_id: Option<RemoteConnId>,
response_sender: Sender<u32>,
},
DeRegisterServerConn {
key: ImutableKey,
conn_id: RemoteConnId,
},
RetireServerConn {
key: ImutableKey,
conn_id: RemoteConnId,
reason: String,
},
SuspectServerConn {
key: ImutableKey,
conn_id: RemoteConnId,
generation: u64,
},
ConfirmServerConn {
key: ImutableKey,
conn_id: RemoteConnId,
generation: u64,
observed_at: Instant,
},
SweepServerLeases,
DeRegisterClientConn {
server_id: Option<RemoteConnId>,
client_id: RemoteConnId,
},
Shutdown,
}Variants§
Direct(DirectTask)
Accept
Register
Fields
key: ImutableKeyconn_id: RemoteConnIdconn_sender: SenderChan<ConnTask>retire_token: CancellationTokenCancelled to tear the control connection’s socket down.
Separate from conn_sender because the two fail independently: a
registration that has stopped reading leaves the writer blocked inside
a single write_msg, and a ConnTask queued behind it is not observed
until that write returns — which, for a half-open socket, may be never.
Retirement has to reach the socket without going through the work queue.
direct: Option<AuthContext>ServerConnActivity
Subcribe
Fields
key: ImutableKeyconn_id: RemoteConnIdconn_sender: SenderChan<ConnTask>excluded_server_conns: Vec<(RemoteConnId, u64)>selected: Option<(RemoteConnId, u64)>Stream
Fields
key: ImutableKeystream: RelayStreamsession: ServerHeaderSessionserver: ConnLeaseThe provider stream socket’s ID, which goes where the stream goes.
client_id: RemoteConnIdStreamAck
Status
StatusQuery
Fields
response_sender: Sender<ServerStatusInfo>AdminServiceList
AdminConnectionList
AdminConnectionRetire
Fields
key: ImutableKeyconn_id: Option<RemoteConnId>Absent retires every connection registered under key.
DeRegisterServerConn
RetireServerConn
SuspectServerConn
A single slow stream requests confirmation, not immediate deregistration.
ConfirmServerConn
Retire only if no authenticated activity followed the suspicion.
SweepServerLeases
Look for registrations that stopped renewing their lease, and retire them.
Sent by a ticker task rather than driven by a timer inside the manager loop:
that loop’s single await is a channel receive, and racing it against a tick
in tokio::select! would drop a task the receive had already taken.
DeRegisterClientConn
A connection that registered no service ended: a subscriber, a direct control connection, or one that registered nothing under its ID.
Fields
server_id: Option<RemoteConnId>The provider stream socket that served this subscriber, once one has:
the connection that sent Stream, not the registered control
connection the subscribe was routed to.
client_id: RemoteConnIdShutdown
Auto Trait Implementations§
impl !Freeze for ManagerTask
impl !RefUnwindSafe for ManagerTask
impl !UnwindSafe for ManagerTask
impl Forget for ManagerTask
impl Move for ManagerTask
impl Send for ManagerTask
impl Sync for ManagerTask
impl Unpin for ManagerTask
impl UnsafeUnpin for ManagerTask
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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