Server

Struct Server 

Source
pub struct Server<C> { /* private fields */ }
Expand description

gRPC server for session reduce service

Implementations§

Source§

impl<C> Server<C>

Source

pub fn new(creator: C) -> Self

Create a new Server with the given session reduce service

Source

pub async fn start_with_shutdown( self, user_shutdown_rx: Receiver<()>, ) -> Result<(), Box<dyn Error + Send + Sync>>
where C: SessionReducerCreator + Send + Sync + 'static,

Starts the gRPC server. When message is received on the shutdown channel, graceful shutdown of the gRPC server will be initiated.

Source

pub async fn start(self) -> Result<(), Box<dyn Error + Send + Sync>>
where C: SessionReducerCreator + Send + Sync + 'static,

Starts the gRPC server. Automatically registers signal handlers for SIGINT and SIGTERM and initiates graceful shutdown of gRPC server when either one of the signal arrives.

Trait Implementations§

Source§

impl<C: Debug> Debug for Server<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C> ServerExtras<C> for Server<C>

Source§

fn transform_inner<F>(self, f: F) -> Self
where F: FnOnce(Server<C>) -> Server<C>,

Extract the inner server, transform it, and wrap it back
Source§

fn inner_ref(&self) -> &Server<C>

Get a reference to the inner server
Source§

fn with_socket_file(self, file: impl Into<PathBuf>) -> Self
where Self: Sized,

Set the unix domain socket file path used by the gRPC server to listen for incoming connections.
Source§

fn socket_file<'a>(&'a self) -> &'a Path
where T: 'a,

Get the unix domain socket file path where gRPC server listens for incoming connections.
Source§

fn with_max_message_size(self, message_size: usize) -> Self
where Self: Sized,

Set the maximum size of an encoded and decoded gRPC message. The value of message_size is in bytes.
Source§

fn max_message_size(&self) -> usize

Get the maximum size of an encoded and decoded gRPC message in bytes.
Source§

fn with_server_info_file(self, file: impl Into<PathBuf>) -> Self
where Self: Sized,

Change the file in which numaflow server information is stored on start up to the new value.
Source§

fn server_info_file<'a>(&'a self) -> &'a Path
where T: 'a,

Get the path to the file where numaflow server info is stored.

Auto Trait Implementations§

§

impl<C> Freeze for Server<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for Server<C>
where C: RefUnwindSafe,

§

impl<C> Send for Server<C>
where C: Send,

§

impl<C> Sync for Server<C>
where C: Sync,

§

impl<C> Unpin for Server<C>
where C: Unpin,

§

impl<C> UnwindSafe for Server<C>
where C: UnwindSafe,

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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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