Skip to main content

ManagerTask

Enum ManagerTask 

Source
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

Fields

§peer_addr: SocketAddr
§

Register

Fields

§need_codec: bool
§is_datagram: bool
§protocol_version: u16
§conn_sender: SenderChan<ConnTask>
§retire_token: CancellationToken

Cancelled 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.

§

ServerConnActivity

Fields

§

Subcribe

Fields

§conn_sender: SenderChan<ConnTask>
§excluded_server_conns: Vec<(RemoteConnId, u64)>
§selected: Option<(RemoteConnId, u64)>
§

Stream

Fields

§data_protocol: Option<u16>
§server: ConnLease

The provider stream socket’s ID, which goes where the stream goes.

§client_id: RemoteConnId
§server_generation: u64
§

StreamAck

Fields

§server_id: RemoteConnId
§client_id: RemoteConnId
§server_generation: u64
§

Status

Fields

§response_sender: Sender<PbConnResponse>
§namespace: u64
§

StatusQuery

Fields

§response_sender: Sender<ServerStatusInfo>
§

AdminServiceList

Fields

§key_id: Option<u64>
§page: u32
§page_size: u16
§response_sender: Sender<AdminServicePage>
§

AdminConnectionList

Fields

§key_id: Option<u64>
§page: u32
§page_size: u16
§response_sender: Sender<AdminConnectionPage>
§

AdminConnectionRetire

Fields

§conn_id: Option<RemoteConnId>

Absent retires every connection registered under key.

§response_sender: Sender<u32>
§

DeRegisterServerConn

Fields

§

RetireServerConn

Fields

§reason: String
§

SuspectServerConn

A single slow stream requests confirmation, not immediate deregistration.

Fields

§generation: u64
§

ConfirmServerConn

Retire only if no authenticated activity followed the suspicion.

Fields

§generation: u64
§observed_at: Instant
§

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: RemoteConnId
§

Shutdown

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more