cc.otavia.core.actor

Members list

Type members

Classlikes

abstract class AcceptedWorkerActor[M <: Call] extends ChannelsActor[M | AcceptedChannel]

Worker actor in the acceptor-worker pattern. Receives AcceptorActor.AcceptedChannel messages from an AcceptorActor and manages the lifecycle of accepted channels (mount, initialize, register).

Worker actor in the acceptor-worker pattern. Receives AcceptorActor.AcceptedChannel messages from an AcceptorActor and manages the lifecycle of accepted channels (mount, initialize, register).

Override afterAccepted to handle successfully registered channels, and resumeAsk to process AcceptorActor.AcceptedChannel alongside other message types.

Type parameters

M

the type of messages this actor can handle alongside AcceptorActor.AcceptedChannel

Attributes

Supertypes
trait Actor[M | AcceptedChannel]
class Object
trait Matchable
class Any
Known subtypes
abstract class AcceptorActor[W <: AcceptedWorkerActor[_ <: Call]] extends ChannelsActor[Bind]

TCP server acceptor actor implementing the acceptor-worker pattern. Binds to a SocketAddress and accepts incoming TCP connections, then distributes them to a pool of AcceptedWorkerActor instances.

TCP server acceptor actor implementing the acceptor-worker pattern. Binds to a SocketAddress and accepts incoming TCP connections, then distributes them to a pool of AcceptedWorkerActor instances.

The acceptor creates a server socket channel via newChannel, binds it via the bind method, and handles accepted channels by forwarding them as AcceptedChannel messages to workers. Workers are created at mount time using the provided workerFactory.

Type parameters

W

the worker actor type that handles accepted channels

Attributes

Companion
object
Supertypes
trait Actor[Bind]
class Object
trait Matchable
class Any
Known subtypes
class HttpServer
object AcceptorActor

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
trait Actor[+M <: Call]

Base trait of the actor model. It has two concrete subclasses:

Base trait of the actor model. It has two concrete subclasses:

  1. cc.otavia.core.actor.StateActor: pure business logic actor
  2. cc.otavia.core.actor.ChannelsActor: IO-capable actor that manages Channel instances

Type parameters

M

the type of messages this actor can handle

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Actor

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Actor.type
abstract class ActorCleaner extends Runnable

Attributes

Supertypes
trait Runnable
class Object
trait Matchable
class Any
trait ActorContext

Runtime context injected into each Actor during mounting. Accessed via Actor.context.

Runtime context injected into each Actor during mounting. Accessed via Actor.context.

Provides access to system-level services and actor identity metadata.

Attributes

Supertypes
class Object
trait Matchable
class Any
trait ActorFactory[A <: Actor[_ <: Call]]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait WorkerFactory[W]

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
AbstractActor[_]
abstract class ChannelsActor[M <: Call]

IO-capable actor that manages Channel instances. Always fully drained during the event loop's IO phase (no time budget), ensuring IO responsiveness is never starved.

IO-capable actor that manages Channel instances. Always fully drained during the event loop's IO phase (no time budget), ensuring IO responsiveness is never starved.

In addition to the standard message handling via resumeAsk / resumeNotice, ChannelsActor provides resumeChannelStack for processing channel-level IO stacks, and lifecycle hooks like afterChannelClosed and afterChannelRegistered for channel events.

Type parameters

M

the type of messages this actor can handle

Attributes

Companion
object
Supertypes
trait Actor[M]
class Object
trait Matchable
class Any
Known subtypes
class AcceptorActor[W]
class HttpServer
class HttpClient
class Client
class Connection
Show all
object ChannelsActor

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class DatagramChannelsActor[M <: Call] extends ChannelsActor[M]

UDP datagram channel actor. Creates and manages datagram (UDP) channels via the system's channel factory.

UDP datagram channel actor. Creates and manages datagram (UDP) channels via the system's channel factory.

Type parameters

M

the type of messages this actor can handle

Attributes

Supertypes
class ChannelsActor[M]
trait Actor[M]
class Object
trait Matchable
class Any

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
abstract class MainActor(val args: Array[String] = ...) extends StateActor[Args]

Application entry point actor. Automatically sends command-line arguments as an Args notice to self on mount.

Application entry point actor. Automatically sends command-line arguments as an Args notice to self on mount.

Subclasses implement main0 to define the application logic. Note that afterMount is finalized to inject the args-sending behavior — override afterMount0 instead for custom mount-time initialization.

Value parameters

args

command-line arguments passed to the application

Attributes

Companion
object
Supertypes
class StateActor[Args]
trait Actor[Args]
class Object
trait Matchable
class Any
object MainActor

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
MainActor.type
abstract class SocketChannelsActor[M <: Call] extends ChannelsActor[M]

TCP socket channel actor. Provides connect operations and manages TCP socket channels.

TCP socket channel actor. Provides connect operations and manages TCP socket channels.

Subclasses implement afterConnected to handle successful connections, and override Connect handling via resumeAsk. The connect method family supports both stack-based (suspend/resume) and direct (future-based) connection patterns.

Type parameters

M

the type of messages this actor can handle

Attributes

Companion
object
Supertypes
class ChannelsActor[M]
trait Actor[M]
class Object
trait Matchable
class Any
Known subtypes
class HttpClient
class Client
class Connection

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class StateActor[M <: Call]

Pure business logic actor with no IO capabilities. Scheduled with a time budget alongside other StateActors, ensuring fair scheduling among many business actor.

Pure business logic actor with no IO capabilities. Scheduled with a time budget alongside other StateActors, ensuring fair scheduling among many business actor.

Override resumeAsk and/or resumeNotice to handle messages. Do NOT use this actor for direct network IO — use ChannelsActor or its subclasses instead.

Type parameters

M

the type of messages this actor can handle

Attributes

Supertypes
trait Actor[M]
class Object
trait Matchable
class Any
Known subtypes
class MainActor
class ProbeActor[M, R]

Types

type MessageOf[A <: Actor[_]] = A match { case Actor[m] => m }

Message type of actor can receive

Message type of actor can receive

Attributes