scala

actors

package actors

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.

Source
package.scala
Note

As of release 2.10.1, replaced by akka.actor package. For migration of existing actors refer to the Actors Migration Guide.

Linear Supertypes
Content Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. actors
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class ![a](ch: Channel[a], msg: a) extends Product with Serializable

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

    Example:
    1. receive {
        case Chan1 ! msg1 => ...
        case Chan2 ! msg2 => ...
      }
  2. trait AbstractActor extends OutputChannel[Any] with CanReply[Any, Any]

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  3. trait Actor extends InternalActor with ReplyReactor

    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:

    • The run-time system can be configured to use a larger thread pool size (for example, by setting the actors.corePoolSize JVM property).
    • The 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.
    • The 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

    Annotations
    @SerialVersionUID() @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  4. trait ActorRef extends AnyRef

    Trait used for migration of Scala actors to Akka.

    Trait used for migration of Scala actors to Akka.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) ActorRef ought to be used only with the Actor Migration Kit.

  5. class AskTimeoutException extends TimeoutException

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  6. trait CanReply[-T, +R] extends AnyRef

    Defines result-bearing message send operations.

    Defines result-bearing message send operations.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  7. class Channel[Msg] extends InputChannel[Msg] with OutputChannel[Msg] with CanReply[Msg, Any]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  8. trait DaemonActor extends Actor

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  9. case class Exit(from: AbstractActor, reason: AnyRef) extends Product with Serializable

    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.

    from

    the actor that terminated

    reason

    the reason that caused the actor to terminate

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  10. abstract class Future[+T] extends Responder[T] with () ⇒ T

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the scala.concurrent.Future instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  11. trait IScheduler extends AnyRef

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  12. trait InputChannel[+Msg] extends AnyRef

    A common interface for all channels from which values can be received.

    A common interface for all channels from which values can be received.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  13. trait InternalReplyReactor extends Reactor[Any] with ReactorCanReply

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  14. trait OutputChannel[-Msg] extends AnyRef

    A common interface for all channels to which values can be sent.

    A common interface for all channels to which values can be sent.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  15. trait Reactor[Msg >: Null] extends OutputChannel[Msg] with Combinators

    Super trait of all actor traits.

    Super trait of all actor traits.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  16. trait ReplyReactor extends InternalReplyReactor

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  17. trait SchedulerAdapter extends IScheduler

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  18. case class UncaughtException(actor: InternalActor, message: Option[Any], sender: Option[OutputChannel[Any]], thread: Thread, cause: Throwable) extends Exception with Product with Serializable

    The exit reason when an actor fails to catch an exception.

    The exit reason when an actor fails to catch an exception.

    actor

    the actor that threw the exception

    message

    the message the actor was processing, or None if no message (e.g. on initial startup)

    sender

    the sender of the most recent message

    thread

    the thread on which the actor was running

    cause

    the uncaught exception

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

Value Members

  1. package remote

  2. package scheduler

Deprecated Value Members

  1. object Actor extends Combinators with Serializable

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  2. object Debug extends Logger

    Provides methods for generating debugging output.

    Provides methods for generating debugging output.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  3. object Futures

    Methods that operate on futures.

    Methods that operate on futures.

    Annotations
    @deprecated
    Deprecated

    (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.

  4. object PoisonPill

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  5. object Scheduler extends DelegatingScheduler

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

  6. object TIMEOUT extends Product with Serializable

    Used as the timeout pattern in receiveWithin and reactWithin.

    Used as the timeout pattern in receiveWithin and reactWithin.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.

    Example:
    1. receiveWithin(500) {
        case (x, y) => ...
        case TIMEOUT => ...
      }

Inherited from AnyRef

Inherited from Any

Ungrouped