@Test public void scheduleMessageToRegisteredActorAfterDelay() throws Exception { final ActorSystemInstance actorSystem = ActorSystemInstance .getInstance("removeOldActorAfterRegisteringNewActorThenKeepNewActor"); MockActor actor = new TestAsync<MockActor>().apply(new Function<CountDownLatch, MockActor>() { @Override public MockActor apply(@NonNull CountDownLatch countDownLatch) { MockActor actor = new MockActor(countDownLatch); actorSystem.register(actor); ActorScheduler.after(10, actorSystem).send(message, MockActor.class); return actor; } }); actorSystem.unregister(MockActor.class); assertTrue(actor.message.getId() == 1); }
@NonNull public static ScheduledMessageSender after(@IntRange(from = 0) long millis) { return after(millis, ActorSystemInstance.getInstance(null)); }
ActorScheduler { @NonNull public static ScheduledMessageSender after(@IntRange(from = 0) long millis) { return after(millis, ActorSystemInstance.getInstance(null)); } }
ActorScheduler { @NonNull public static ScheduledMessageSender after(@IntRange(from = 0) long millis) { return after(millis, ActorSystemInstance.getInstance(null)); } ActorScheduler(); }
ActorScheduler { @NonNull public static ScheduledMessageSender after(@IntRange(from = 0) long millis) { return after(millis, ActorSystemInstance.getInstance(null)); } ActorScheduler(); @NonNull static ScheduledMessageSender after(@IntRange(from = 0) long millis); static void cancel(@NonNull Class<?> actorAddress); }
ActorScheduler { @NonNull public static ScheduledMessageSender after(@IntRange(from = 0) long millis) { return after(millis, ActorSystemInstance.getInstance(null)); } ActorScheduler(); @NonNull static ScheduledMessageSender after(@IntRange(from = 0) long millis); static void cancel(@NonNull Class<?> actorAddress);  }