cc.otavia.core.system

Members list

Type members

Classlikes

object ActorHouse

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ActorHouse.type
trait ActorSystem

ActorSystem is a container of actor and channel group instance, a actor or channel group instance must be create by a actor system instance, actor instance in different actor system instance can not send message directly.

ActorSystem is a container of actor and channel group instance, a actor or channel group instance must be create by a actor system instance, actor instance in different actor system instance can not send message directly.

only Notice message can send to a actor or channel group out side actor and channel group

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ActorSystem

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
final class ActorThread(val system: ActorSystem, id: Int) extends Thread

The central execution unit of the Otavia runtime. Each ActorThread is simultaneously the IO thread (polling the OS selector for network/file events) and the actor execution thread (running user business logic).

The central execution unit of the Otavia runtime. Each ActorThread is simultaneously the IO thread (polling the OS selector for network/file events) and the actor execution thread (running user business logic).

Every actor is pinned to a single ActorThread for its entire lifetime. All actor on the same thread are single-threaded with respect to each other, eliminating the need for locks on intra-thread coordination.

The event loop has three phases per iteration:

  1. '''Phase 1 — IO''': Poll the selector and process IO events
  2. '''Phase 2 — ChannelsActor dispatch''': Fully drain IO-capable actor and pending events (no time budget)
  3. '''Phase 3 — StateActor dispatch''': Run business logic actor within a time budget

Attributes

Companion
object
Supertypes
class Thread
trait Runnable
class Object
trait Matchable
class Any
object ActorThread

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class ActorThreadFactory

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class AddressPhantomReference(referent: ActorAddress[_], queue: ReferenceQueue[ActorAddress[_]]) extends PhantomReference[ActorAddress[_]]

Attributes

Supertypes
class PhantomReference[ActorAddress[_]]
class Reference[ActorAddress[_]]
class Object
trait Matchable
class Any
class DefaultActorThreadPool(val system: ActorSystem, val actorThreadFactory: ActorThreadFactory, val size: Int) extends ActorThreadPool

Attributes

Supertypes
class Object
trait Matchable
class Any
class FIFOHouseQueue(manager: HouseManager) extends HouseQueue

Attributes

Supertypes
class HouseQueue
class Object
trait Matchable
class Any
object House

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
House.type
final class HouseManager(val thread: ActorThread)

Per-ActorThread scheduler that manages three priority queues for actor house scheduling.

Per-ActorThread scheduler that manages three priority queues for actor house scheduling.

Queue assignment is based on actor type:

  • '''mountingQueue''' (FIFO): houses awaiting initial mount (all types)
  • '''channelsActorQueue''' (Priority): IO-capable actor, fully drained in Phase 2 with no time budget
  • '''actorQueue''' (Priority): business logic actor, time-budgeted in Phase 3

Each PriorityHouseQueue has two sub-queues: normal priority and high priority. Houses are classified as high priority based on three signals (see ActorHouse._highPriority): reply backlog, event backlog, and no downstream blocking (no pending promises). Priority is determined at enqueue time; there is no mid-queue promotion.

Value parameters

thread

the owning ActorThread

Attributes

Supertypes
class Object
trait Matchable
class Any
abstract class HouseQueue(val manager: HouseManager)

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Mailbox(val house: ActorHouse)

Attributes

Supertypes
class Object
trait Matchable
class Any
class PriorityHouseQueue(manager: HouseManager) extends HouseQueue

A priority-aware MPSC house queue with two sub-queues: high-priority and normal-priority.

A priority-aware MPSC house queue with two sub-queues: high-priority and normal-priority.

'''Dequeue order:''' high-priority sub-queue is always drained before the normal sub-queue (strict priority). This guarantees that actors that can immediately push the system forward (reply/event backlogs, or no downstream blocking — see ActorHouse._highPriority) are always served before normal actors.

'''Priority is determined at enqueue time.''' The ActorHouse._highPriority cached flag is read once when the house enters the queue (via ActorHouse.waitingToReadyHouseManager.readyenqueue). A house that becomes high-priority while already queued will be correctly prioritized on its next enqueue (after ActorHouse.completeRunning re-evaluates the flag).

'''Concurrency model:''' SpinLock-based MPSC. Multiple producer threads can enqueue concurrently; the owning ActorThread dequeues via dequeue. Other threads may attempt opportunistic steals via stealDequeue, which uses SpinLock.tryLock to avoid spinning on the owner's lock. Each sub-queue has independent read/write lock pairs to avoid cross-priority contention.

'''Schedule() outside lock:''' the READY → SCHEDULED CAS in ActorHouse.schedule is performed after releasing the queue lock. This is safe because no other thread can change the house state between unlock and schedule: the house is in READY state, removed from the queue, and no lifecycle transition is possible until schedule() fires.

Attributes

Supertypes
class HouseQueue
class Object
trait Matchable
class Any
object SystemInfo

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
SystemInfo.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TilingThreadSelector(threads: Array[ActorThread]) extends ThreadSelector

Attributes

Supertypes
class Object
trait Matchable
class Any