Struct console_subscriber::Server
source · [−]pub struct Server { /* private fields */ }
Expand description
A gRPC Server
that implements the tokio-console
wire format.
Client applications, such as the [tokio-console CLI][cli] connect to the gRPC server, and stream data about the runtime's history (such as a list of the currently active tasks, or statistics summarizing polling times). A [
Server`] also
interprets commands from a client application, such a request to focus in on
a specific task, and translates that into a stream of details specific to
that task.
Implementations
A Server
by default binds socket address 127.0.0.1 to service remote
procedure calls.
Note that methods like init
and
spawn
will parse the socket address from the
TOKIO_CONSOLE_BIND
environment variable before falling back on
constructing a socket address from this default.
See also Builder::server_addr
.
A Server
by default binds port 6669 to service remote procedure
calls.
Note that methods like init
and
spawn
will parse the socket address from the
TOKIO_CONSOLE_BIND
environment variable before falling back on
constructing a socket address from this default.
See also Builder::server_addr
.
Starts the gRPC service with the default gRPC settings.
To configure gRPC server settings before starting the server, use
serve_with
instead. This method is equivalent to calling serve_with
and providing the default gRPC server settings:
server.serve_with(tonic::transport::Server::default()).await
Starts the gRPC service with the given tonic
gRPC transport server
builder
.
The builder
parameter may be used to configure gRPC-specific settings
prior to starting the server.
This spawns both the server task and the event aggregation worker task on the current async runtime.
Trait Implementations
type WatchUpdatesStream = ReceiverStream<Result<Update, Status>>
type WatchUpdatesStream = ReceiverStream<Result<Update, Status>>
Server streaming response type for the WatchUpdates method.
Server streaming response type for the WatchTaskDetails method.
fn watch_updates<'life0, 'async_trait>(
&'life0 self,
req: Request<InstrumentRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchUpdatesStream>, Status>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn watch_updates<'life0, 'async_trait>(
&'life0 self,
req: Request<InstrumentRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchUpdatesStream>, Status>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Produces a stream of updates representing the behavior of the instrumented async runtime.
fn watch_task_details<'life0, 'async_trait>(
&'life0 self,
req: Request<TaskDetailsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchTaskDetailsStream>, Status>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn watch_task_details<'life0, 'async_trait>(
&'life0 self,
req: Request<TaskDetailsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchTaskDetailsStream>, Status>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Produces a stream of updates describing the activity of a specific task.
Registers that the console observer wants to pause the stream.
Auto Trait Implementations
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more