pub struct ConversationActor { /* private fields */ }Implementations§
Source§impl ConversationActor
impl ConversationActor
Sourcepub fn handle(&self) -> ConversationHandle
pub fn handle(&self) -> ConversationHandle
Returns a cloneable command handle.
Sourcepub fn pid(&self) -> Result<ParticipantPid, LiminalError>
pub fn pid(&self) -> Result<ParticipantPid, LiminalError>
Returns the current actor PID, restarting after crash when needed.
§Errors
Returns LiminalError when the actor is closed or cannot restart.
Sourcepub fn state(&self) -> Result<ConversationState, LiminalError>
pub fn state(&self) -> Result<ConversationState, LiminalError>
Sourcepub fn receive_timeout(
&self,
timeout: Duration,
) -> Result<Envelope, LiminalError>
pub fn receive_timeout( &self, timeout: Duration, ) -> Result<Envelope, LiminalError>
Receives the next reply from the conversation, bounded by timeout.
Returns LiminalError::ConversationTimeout if no reply arrives in time,
or LiminalError::ParticipantCrashed if a linked participant crashes
while waiting (the crash drains the pending receive immediately).
§Errors
Returns LiminalError on timeout, participant crash, or actor failure.
Sourcepub fn try_take_reply(&self) -> Option<Envelope>
pub fn try_take_reply(&self) -> Option<Envelope>
R1(vi)(a): non-blocking drain of one buffered participant reply, if any.
The connection polls this on its own slice (woken by the reply-availability
notifier) instead of blocking the slice on receive_timeout.
Sourcepub fn has_pending_reply(&self) -> bool
pub fn has_pending_reply(&self) -> bool
Whether a participant reply is buffered without consuming it.
Sourcepub fn register_reply_notifier(&self, notifier: Arc<dyn Fn() + Send + Sync>)
pub fn register_reply_notifier(&self, notifier: Arc<dyn Fn() + Send + Sync>)
R1(vi)(a): installs the reply-availability notifier, fired on the reply queue’s empty→non-empty transition and on terminal actor error. Installed permanently at conversation open; cleared at close/finalize.
Sourcepub fn finalize(&self)
pub fn finalize(&self)
Finalizes the conversation without requiring its actor process to run:
bounded, non-blocking, and idempotent. Terminates the actor and every
participant directly (scheduler tombstone writes, not requests into the
actor’s command loop), fails pending receives and queued commands with
the typed closed error, and removes both runtime registrations. This is
the teardown-path counterpart to ConversationHandle::close: a caller
releasing a conversation during ITS OWN teardown must never block on the
conversation scheduler being live or responsive.
Sourcepub fn notify_on_participant_exit(
&self,
participant: ParticipantPid,
notifier: SyncSender<Instant>,
) -> Result<(), LiminalError>
pub fn notify_on_participant_exit( &self, participant: ParticipantPid, notifier: SyncSender<Instant>, ) -> Result<(), LiminalError>
Registers a one-shot notifier fired the instant participant’s trapped
EXIT is processed (carrying the observed Instant — a structural link
wakeup, not a poll). If participant is already dead at registration
(it crashed before this call), the recorded EXIT instant is replayed
immediately, so a crash-before-register is never lost. See
[ActorCore::register_exit_notifier].
§Errors
Returns LiminalError when a state or registry lock is poisoned.
Trait Implementations§
Source§impl Clone for ConversationActor
impl Clone for ConversationActor
Source§fn clone(&self) -> ConversationActor
fn clone(&self) -> ConversationActor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more