2011-05-02 18:22:13 +02:00
|
|
|
Scheduler
|
|
|
|
|
=========
|
|
|
|
|
|
2011-12-13 01:44:18 +01:00
|
|
|
Sometimes the need for making things happen in the future arises, and where do you go look then?
|
|
|
|
|
Look no further than ``ActorSystem``! There you find the :meth:``scheduler`` method that returns an instance
|
|
|
|
|
of akka.actor.Scheduler, this instance is unique per ActorSystem and is used internally for scheduling things
|
|
|
|
|
to happen at specific points in time. Please note that the scheduled tasks are executed by the default
|
|
|
|
|
``MessageDispatcher`` of the ``ActorSystem``.
|
2011-05-02 18:22:13 +02:00
|
|
|
|
2011-12-13 01:44:18 +01:00
|
|
|
From ``akka.actor.ActorSystem``
|
|
|
|
|
-------------------------------
|
2011-05-02 18:22:13 +02:00
|
|
|
|
2011-12-13 01:44:18 +01:00
|
|
|
.. includecode:: ../../akka-actor/src/main/scala/akka/actor/ActorSystem.scala
|
|
|
|
|
:include: scheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Scheduler interface
|
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
|
|
.. includecode:: ../../akka-actor/src/main/scala/akka/actor/Scheduler.scala
|
|
|
|
|
:include: scheduler
|
|
|
|
|
|
|
|
|
|
The Cancellable interface
|
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
|
|
This allows you to ``cancel`` something that has been scheduled for execution.
|
|
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
This does not abort the execution of the task, if it had already been started.
|
|
|
|
|
|
|
|
|
|
.. includecode:: ../../akka-actor/src/main/scala/akka/actor/Scheduler.scala
|
|
|
|
|
:include: cancellable
|
2011-05-02 18:22:13 +02:00
|
|
|
|