Skip to main content

LiminalConnectionServices

Struct LiminalConnectionServices 

Source
pub struct LiminalConnectionServices { /* private fields */ }
Expand description

Default adapter from server wire frames to liminal channel/conversation APIs.

Implementations§

Source§

impl LiminalConnectionServices

Source

pub fn from_config(config: &ServerConfig) -> Result<Self, ServerError>

Builds library-backed services from validated server configuration.

Durable-mode channels are backed by a shared haematite event store so their publishes are persisted and survive the graceful-shutdown flush; ephemeral channels carry no store.

§Errors

Returns ServerError when a configured channel cannot be initialized.

Source

pub fn from_config_with_store( config: &ServerConfig, durable_store: Arc<dyn DurableStore>, ) -> Result<Self, ServerError>

Builds services over a caller-provided durable store.

Used by tests that need to inspect persisted state through the same store handle the durable channels write to.

§Errors

Returns ServerError when a configured channel cannot be initialized.

Source

pub fn empty() -> Result<Self, ServerError>

Builds services with no configured channels.

§Errors

Returns ServerError when the conversation supervisor scheduler cannot start.

Source

pub const fn channel_cluster(&self) -> &ChannelCluster

The shared channel supervisor + cluster resolver backing this service.

The server runtime uses this to attach the cluster to the channel supervisor’s clustered scheduler (SRV-005).

Source

pub fn durable_store(&self) -> Arc<dyn DurableStore>

Returns the shared durable store backing this service’s durable channels.

Source

pub fn conversation_supervisor(&self) -> Arc<ConversationSupervisor>

Returns the conversation supervisor backing supervised conversations.

Tests use this to reach the underlying beamr scheduler so they can spawn or terminate participant processes and exercise crash detection.

Source

pub fn register_responder( &self, subject: impl Into<String>, behaviour: Arc<dyn ParticipantBehaviour>, ) -> Result<Option<Arc<dyn ParticipantBehaviour>>, ServerError>

Registers a custom conversation responder for a routing subject.

When a conversation is later opened with this exact subject, its participant runs behaviour instead of the built-in EchoBehaviour. The responder is spawned and supervised identically to the echo participant — a real linked beamr process with the same crash-detection semantics — so this exposes the responder seam without changing how participants run. Registering a subject that already has a responder replaces it; the previous behaviour is returned.

This is the liminal-side seam aion #13 plugs a remote worker into: it registers a responder that forwards each request to the worker and routes the worker’s reply back through the conversation. Subjects with no registration keep echoing, so existing callers are unaffected.

§Errors

Returns ServerError when the responder registry lock is poisoned.

Source

pub fn unregister_responder( &self, subject: &str, ) -> Result<Option<Arc<dyn ParticipantBehaviour>>, ServerError>

Removes the custom responder registered for subject, if any.

After removal the subject reverts to the built-in EchoBehaviour on the next Self::open_conversation. Returns the removed behaviour when one was registered.

§Errors

Returns ServerError when the responder registry lock is poisoned.

Trait Implementations§

Source§

impl ConnectionServices for LiminalConnectionServices

Source§

fn publish( &self, channel: &str, envelope: &MessageEnvelope, idempotency_key: Option<&str>, ) -> Result<PublishOutcome, ServerError>

Delegates a publish request to the liminal library. Read more
Source§

fn subscribe( &self, channel: &str, accepted_schemas: &[ProtocolSchemaId], ) -> Result<ConnectionSubscription, ServerError>

Delegates a subscribe request to the liminal library. Read more
Source§

fn unsubscribe( &self, subscription: ConnectionSubscription, ) -> Result<(), ServerError>

Delegates unsubscribe to the liminal library. Read more
Source§

fn open_conversation( &self, conversation_id: u64, subject: &str, ) -> Result<ConnectionConversation, ServerError>

Delegates conversation open to the liminal library. Read more
Source§

fn conversation_message( &self, conversation: &ConnectionConversation, envelope: &MessageEnvelope, ) -> Result<(), ServerError>

Delegates a conversation message to the liminal library. Read more
Source§

fn close_conversation( &self, conversation: ConnectionConversation, ) -> Result<(), ServerError>

Delegates conversation close to the liminal library. Read more
Source§

fn flush_durable_state(&self) -> Result<(), ServerError>

Flushes durable channel state through the liminal library boundary. Read more
Source§

impl Debug for LiminalConnectionServices

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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