Used to pattern match on values that were sent to some channel Chann
by the current actor self
.
Used to pattern match on values that were sent to some channel Chann
by the current actor self
.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
receive { case Chan1 ! msg1 => ... case Chan2 ! msg2 => ... }
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Provides lightweight, concurrent actors.
Provides lightweight, concurrent actors. Actors are created by extending
the Actor
trait (alternatively, one of the factory methods in its
companion object can be used). The behavior of an Actor
subclass is
defined by implementing its act
method:
class MyActor extends Actor { def act() { // actor behavior goes here } }
A new Actor
instance is started by invoking its start
method.
Note: care must be taken when invoking thread-blocking methods other
than those provided by the Actor
trait or its companion object (such as
receive
). Blocking the underlying thread inside an actor may lead to
starvation of other actors. This also applies to actors hogging their
thread for a long time between invoking receive
/react
.
If actors use blocking operations (for example, methods for blocking I/O), there are several options:
actors.corePoolSize
JVM property).scheduler
method of the Actor
trait can be overridden to return a
ResizableThreadPoolScheduler
, which resizes its thread pool to
avoid starvation caused by actors that invoke arbitrary blocking methods.actors.enableForkJoin
JVM property can be set to false
, in which
case a ResizableThreadPoolScheduler
is used by default to execute actors.The main ideas of the implementation are explained in the two papers
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Trait used for migration of Scala actors to Akka.
Trait used for migration of Scala actors to Akka.
(Since version 2.10.0) ActorRef ought to be used only with the Actor Migration Kit.
This is what is used to complete a Future that is returned from an ask/? call, when it times out.
This is what is used to complete a Future that is returned from an ask/? call, when it times out.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Defines result-bearing message send operations.
Defines result-bearing message send operations.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Provides a means for typed communication among actors.
Provides a means for typed communication among actors. Only the
actor creating an instance of a Channel
may receive from it.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Base trait for actors with daemon semantics.
Base trait for actors with daemon semantics.
Unlike a regular Actor
, an active DaemonActor
will not
prevent an application terminating, much like a daemon thread.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Sent to an actor
with trapExit
set to true
whenever one of its linked actors
terminates.
Sent to an actor
with trapExit
set to true
whenever one of its linked actors
terminates.
the actor that terminated
the reason that caused the actor to terminate
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
A function of arity 0, returing a value of type T
that,
when applied, blocks the current actor (Actor.self
)
until the future's value is available.
A function of arity 0, returing a value of type T
that,
when applied, blocks the current actor (Actor.self
)
until the future's value is available.
A future can be queried to find out whether its value is already available without blocking.
(Since version 2.11.0) Use the scala.concurrent.Future instead. For migration from the scala.actors package refer to the Actors Migration Guide.
A common interface for all schedulers used to execute actor tasks.
A common interface for all schedulers used to execute actor tasks.
Subclasses of Actor
that override its scheduler
member must provide
an IScheduler
implementation.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
A common interface for all channels from which values can be received.
A common interface for all channels from which values can be received.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Extends the scala.actors.Reactor trait with methods to reply to the sender of a message.
Extends the scala.actors.Reactor
trait with methods to reply to the sender of a message.
Sending a message to a ReplyReactor
implicitly
passes a reference to the sender together with the message.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
A common interface for all channels to which values can be sent.
A common interface for all channels to which values can be sent.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Super trait of all actor traits.
Super trait of all actor traits.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Adapts the behavior of the standard scala.actors.Scheduler object.
Adapts the behavior of the standard scala.actors.Scheduler object.
Providing an implementation for the
execute(f: => Unit)
method is sufficient to
obtain a concrete IScheduler
implementation.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
The exit reason when an actor fails to catch an exception.
The exit reason when an actor fails to catch an exception.
the actor that threw the exception
the message the actor was processing, or None if no message (e.g. on initial startup)
the sender of the most recent message
the thread on which the actor was running
the uncaught exception
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Provides functions for the definition of actors, as well as actor
operations, such as receive
, react
, reply
, etc.
Provides functions for the definition of actors, as well as actor
operations, such as receive
, react
, reply
, etc.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Provides methods for generating debugging output.
Provides methods for generating debugging output.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Methods that operate on futures.
Methods that operate on futures.
(Since version 2.11.0) Use the object scala.concurrent.Future instead. For migration from the scala.actors package refer to the Actors Migration Guide.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Used by scala.actors.Actor instances to execute tasks of an actor execution.
Used by scala.actors.Actor instances to execute tasks of an actor execution.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
Used as the timeout pattern in
receiveWithin
and
reactWithin
.
Used as the timeout pattern in
receiveWithin
and
reactWithin
.
(Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.
receiveWithin(500) { case (x, y) => ... case TIMEOUT => ... }
A library that provides both asynchronous and synchronous messaging to allow for concurrent programming without explicit synchronization.
Guide
A detailed guide for the actors library is available http://docs.scala-lang.org/overviews/core/actors.html.
Getting Started
A starting point for using the actors library would be scala.actors.Reactor, scala.actors.ReplyReactor, or scala.actors.Actor or their companion objects.
As of release 2.10.1, replaced by
akka.actor
package. For migration of existing actors refer to the Actors Migration Guide.