Making it possible/mandatory to signal which ExecutionContext will actually execute something scheduled

This commit is contained in:
Viktor Klang 2012-08-08 15:57:30 +02:00
parent a8f648ef1c
commit 9d097bcf50
22 changed files with 135 additions and 120 deletions

View file

@ -46,7 +46,7 @@ public class SchedulerDocTestBase {
public void scheduleOneOffTask() {
//#schedule-one-off-message
//Schedules to send the "foo"-message to the testActor after 50ms
system.scheduler().scheduleOnce(Duration.create(50, TimeUnit.MILLISECONDS), testActor, "foo");
system.scheduler().scheduleOnce(Duration.create(50, TimeUnit.MILLISECONDS), testActor, "foo", system.dispatcher());
//#schedule-one-off-message
//#schedule-one-off-thunk
@ -56,7 +56,7 @@ public class SchedulerDocTestBase {
public void run() {
testActor.tell(System.currentTimeMillis());
}
});
}, system.dispatcher());
//#schedule-one-off-thunk
}
@ -80,7 +80,7 @@ public class SchedulerDocTestBase {
//This will schedule to send the Tick-message
//to the tickActor after 0ms repeating every 50ms
Cancellable cancellable = system.scheduler().schedule(Duration.Zero(), Duration.create(50, TimeUnit.MILLISECONDS),
tickActor, "Tick");
tickActor, "Tick", system.dispatcher());
//This cancels further Ticks to be sent
cancellable.cancel();