@Test public void sendTheSameMessageTwiceBeforeTheFirstOneReceivedAndIgnoreTheSecond() throws Exception { final ActorSystemInstance actorSystem = ActorSystemInstance .getInstance("sendTheSameMessageTwiceBeforeTheFirstOneReceivedAndIgnoreTheSecond"); MockActor actor = new TestAsync<MockActor>().apply(new Function<CountDownLatch, MockActor>() { @Override public MockActor apply(@NonNull CountDownLatch countDownLatch) { Message message = new Message(1, 1); Message messageTwo = new Message(1, 2); MockActorNine actor = new MockActorNine(countDownLatch); actorSystem.register(actor); ActorScheduler.after(50, actorSystem).send(message, MockActorNine.class); ActorScheduler.after(20, actorSystem).send(messageTwo, MockActorNine.class); return actor; } }); actorSystem.unregister(MockActorNine.class); assertTrue(actor.message.getContent().equals(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);  }