Skip to content

CanKit.Pro.Actor Namespace

Classes
ProtocolActor Default IProtocolActor: one mailbox (System.Collections.Concurrent.ConcurrentQueue<> of work items), one loop, one sorted list of pending timers — both owned exclusively by whichever thread is currently running the loop, so neither needs its own lock (FR-RAW-020/021). The loop blocks on a SemaphoreSlim for either new mailbox work or the next timer deadline, whichever comes first, and never polls (FR-RAW-022). Any exception from a posted work item or a fired timer is caught and raised via BackgroundExceptionOccurred; the loop keeps running afterward (FR-RAW-023).
Interfaces
IProtocolActor A protocol instance's documented threading model (arc42 §8.3, ADR-6; FR-RAW-020..024): exactly one mailbox, processed by exactly one logical loop, so a protocol instance's internal state (channel registers, timer queues, state machines) is never mutated from more than one place at a time — no locks needed by the protocol code itself (FR-RAW-020/021). Scheduling is event-driven, never a busy loop (FR-RAW-022); background exceptions are surfaced via BackgroundExceptionOccurred instead of being thrown on some unrelated caller thread or lost as an unobserved task exception (FR-RAW-023).
Enums
ActorExecutionMode Chooses the execution context a ProtocolActor runs its single mailbox loop on (arc42 §8.3/ADR-6; FR-RAW-024).