ActorRef

ox.channels.ActorRef
class ActorRef[T](c: Sink[T => Unit])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def ask[U](f: T => U): U

Send an invocation to the actor and await for the result.

Send an invocation to the actor and await for the result.

The f function should be an invocation of a method on T and should not directly or indirectly return the T value, as this might expose the actor's internal mutable state to other threads.

Any non-fatal exceptions thrown by f will be propagated to the caller and the actor will continue processing other invocations. Fatal exceptions will be propagated to the actor's enclosing scope, and the actor will close.

Attributes

def tell(f: T => Unit): Unit

Send an invocation to the actor that should be processed in the background (fire-and-forget). Might block until there's enough space in the actor's mailbox (incoming channel).

Send an invocation to the actor that should be processed in the background (fire-and-forget). Might block until there's enough space in the actor's mailbox (incoming channel).

Any exceptions thrown by f will be propagated to the actor's enclosing scope, and the actor will close.

Attributes