pub struct LiminalConnectionServices { /* private fields */ }Expand description
Default adapter from server wire frames to liminal channel/conversation APIs.
Implementations§
Source§impl LiminalConnectionServices
impl LiminalConnectionServices
Sourcepub fn from_config(config: &ServerConfig) -> Result<Self, ServerError>
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.
Sourcepub fn from_config_with_store(
config: &ServerConfig,
durable_store: Arc<dyn DurableStore>,
) -> Result<Self, ServerError>
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.
Sourcepub fn empty() -> Result<Self, ServerError>
pub fn empty() -> Result<Self, ServerError>
Builds services with no configured channels.
§Errors
Returns ServerError when the conversation supervisor scheduler cannot start.
Sourcepub const fn channel_cluster(&self) -> &ChannelCluster
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).
Sourcepub fn durable_store(&self) -> Arc<dyn DurableStore>
pub fn durable_store(&self) -> Arc<dyn DurableStore>
Returns the shared durable store backing this service’s durable channels.
Sourcepub fn conversation_supervisor(&self) -> Arc<ConversationSupervisor>
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.
Sourcepub fn register_responder(
&self,
subject: impl Into<String>,
behaviour: Arc<dyn ParticipantBehaviour>,
) -> Result<Option<Arc<dyn ParticipantBehaviour>>, ServerError>
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.
Sourcepub fn unregister_responder(
&self,
subject: &str,
) -> Result<Option<Arc<dyn ParticipantBehaviour>>, ServerError>
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.