diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-05-28 20:42:07 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-05-28 20:42:07 +0000 |
commit | dbb58b11702cee27b5ea70c5d1dd71986f34c79d (patch) | |
tree | ad68fbb2b7994a1b3b292791de7fda9293c4d830 /src/actors | |
parent | e1424d97d5386275003b40c60a7b36c5f5fd87d7 (diff) | |
download | scala-dbb58b11702cee27b5ea70c5d1dd71986f34c79d.tar.gz scala-dbb58b11702cee27b5ea70c5d1dd71986f34c79d.tar.bz2 scala-dbb58b11702cee27b5ea70c5d1dd71986f34c79d.zip |
Re-enabled SchedulerAdapter.
Diffstat (limited to 'src/actors')
-rw-r--r-- | src/actors/scala/actors/SchedulerAdapter.scala | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/actors/scala/actors/SchedulerAdapter.scala b/src/actors/scala/actors/SchedulerAdapter.scala index c56f3b0f9c..f47f0cbd0f 100644 --- a/src/actors/scala/actors/SchedulerAdapter.scala +++ b/src/actors/scala/actors/SchedulerAdapter.scala @@ -6,6 +6,8 @@ ** |/ ** \* */ +// $Id$ + package scala.actors /** The <code>SchedulerAdapter</code> trait is used to adapt @@ -15,7 +17,6 @@ package scala.actors * <code>execute(f: => Unit)</code> method is sufficient to * obtain a concrete class that extends <code>IScheduler</code>. * - * @version 0.9.18 * @author Philipp Haller */ trait SchedulerAdapter extends IScheduler { @@ -32,4 +33,32 @@ trait SchedulerAdapter extends IScheduler { def shutdown(): Unit = Scheduler.shutdown() + /** When the scheduler is active, it can execute tasks. + */ + def isActive: Boolean = + Scheduler.isActive + + /** Registers a newly created actor with this scheduler. + * + * @param a the actor to be registered + */ + def newActor(a: OutputChannelActor) = + Scheduler.newActor(a) + + /** Unregisters an actor from this scheduler, because it + * has terminated. + * + * @param a the actor to be unregistered + */ + def terminated(a: OutputChannelActor) = + Scheduler.terminated(a) + + /** Registers a closure to be executed when the specified + * actor terminates. + * + * @param a the actor + * @param f the closure to be registered + */ + def onTerminate(a: OutputChannelActor)(f: => Unit) = + Scheduler.onTerminate(a)(f) } |