scala.actors

trait ActorGC

[source: scala/actors/ActorGC.scala]

trait ActorGC
extends IScheduler
ActorGC keeps track of the number of live actors being managed by a a scheduler so that it can shutdown when all of the actors it manages have either been explicitly terminated or garbage collected. When an actor is started, it is registered with the ActorGC via the newActor method, and when an actor is knowingly terminated (e.g. act method finishes, exit explicitly called, an exception is thrown), the ActorGC is informed via the terminated method.
Direct Known Subclasses:
FJTaskScheduler2, SchedulerService

Method Summary
protected def allTerminated : Boolean
protected def gc : Unit
Removes unreachable actors from refSet.
def newActor (a : Reactor) : Unit
newActor is invoked whenever a new actor is started.
def onTerminate (a : Reactor)(f : => Unit) : Unit
Registers a closure to be executed when the specified actor terminates.
protected def status : Unit
def terminated (a : Reactor) : Unit
Unregisters an actor from this scheduler, because it has terminated.
Methods inherited from IScheduler
execute (abstract), execute (abstract), shutdown (abstract), isActive (abstract), managedBlock (abstract), executeFromActor
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def newActor(a : Reactor) : Unit
newActor is invoked whenever a new actor is started.
Overrides
IScheduler.newActor

protected def gc : Unit
Removes unreachable actors from refSet.

protected def status : Unit

protected def allTerminated : Boolean

def onTerminate(a : Reactor)(f : => Unit) : Unit
Registers a closure to be executed when the specified actor terminates.
Parameters
a - the actor
f - the closure to be registered
Overrides
IScheduler.onTerminate

def terminated(a : Reactor) : Unit
Unregisters an actor from this scheduler, because it has terminated.
Parameters
a - the actor to be registered
Overrides
IScheduler.terminated