Struct Service

Source
pub struct Service { /* private fields */ }

Implementations§

Source§

impl Service

Source

pub fn new(id: ID) -> Self

Create a new Service

Source

pub fn with_config(self, config: ServiceConfiguration) -> Self

Set the configuration of the service

Source

pub fn with_message_processor( self, message_processor: Arc<MessageProcessor>, ) -> Self

Set the message processor of the service

Source

pub fn config(&self) -> &ServiceConfiguration

get the service configuration

Source

pub fn signal(self) -> Signal

get signal used to shutdown the service NOTE: this method consumes the service!

Source

pub async fn run(&mut self) -> Result<(), ServiceError>

Run the service

Source

pub async fn create_agent( &self, agent_name: &Agent, ) -> Result<AppChannelReceiver, ServiceError>

Source

pub async fn delete_agent(&self, agent_name: &Agent) -> Result<(), ServiceError>

Source

pub fn run_server(&self, config: &ServerConfig) -> Result<(), ServiceError>

Source

pub fn stop_server(&self, endpoint: &str) -> Result<(), ServiceError>

Source

pub async fn connect(&self, config: &ClientConfig) -> Result<u64, ServiceError>

Source

pub fn disconnect(&self, conn: u64) -> Result<(), ServiceError>

Source

pub fn get_connection_id(&self, endpoint: &str) -> Option<u64>

Source

pub async fn subscribe( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: Option<u64>, ) -> Result<(), ServiceError>

Source

pub async fn unsubscribe( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: Option<u64>, ) -> Result<(), ServiceError>

Source

pub async fn set_route( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: u64, ) -> Result<(), ServiceError>

Source

pub async fn remove_route( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: u64, ) -> Result<(), ServiceError>

Source

pub async fn publish_to( &self, source: &Agent, session_info: Info, agent_type: &AgentType, agent_id: Option<u64>, forward_to: u64, blob: Vec<u8>, ) -> Result<(), ServiceError>

Source

pub async fn publish( &self, source: &Agent, session_info: Info, agent_type: &AgentType, agent_id: Option<u64>, blob: Vec<u8>, ) -> Result<(), ServiceError>

Source

pub async fn publish_with_flags( &self, source: &Agent, session_info: Info, agent_type: &AgentType, agent_id: Option<u64>, flags: AgpHeaderFlags, blob: Vec<u8>, ) -> Result<(), ServiceError>

Source

pub async fn create_session( &self, agent: &Agent, session_config: SessionConfig, ) -> Result<Info, ServiceError>

Create a new session

Source

pub async fn set_session_config( &self, agent: &Agent, session_config: &SessionConfig, session_id: Option<Id>, ) -> Result<(), ServiceError>

Set config for a session

Source

pub async fn get_session_config( &self, agent: &Agent, session_id: Id, ) -> Result<SessionConfig, ServiceError>

Get config for a session

Source

pub async fn get_default_session_config( &self, agent: &Agent, session_type: SessionType, ) -> Result<SessionConfig, ServiceError>

Get default session config

Source

pub async fn delete_session( &self, agent: &Agent, session_id: Id, ) -> Result<(), ServiceError>

delete a session

Trait Implementations§

Source§

impl Component for Service

Source§

fn identifier(&self) -> &ID

Source§

async fn start(&mut self) -> Result<(), ComponentError>

Source§

impl Debug for Service

Source§

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

Formats the value using the given formatter. Read more

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

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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<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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T