Package sudoku
Class Timer
- java.lang.Object
-
- akka.actor.typed.Behavior<T>
-
- akka.actor.typed.ExtensibleBehavior<T>
-
- akka.actor.typed.javadsl.AbstractBehavior<Timer.Protocol>
-
- sudoku.Timer
-
public class Timer extends akka.actor.typed.javadsl.AbstractBehavior<Timer.Protocol>
Simple reactive agent that replies after some time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Timer.CreateMsg
Message creating the agent, as well as starting the countdown.static interface
Timer.Protocol
Protocol interface for input messages.-
Nested classes/interfaces inherited from class akka.actor.typed.Behavior
akka.actor.typed.Behavior.BehaviorDecorators<Inner extends Object>, akka.actor.typed.Behavior.BehaviorDecorators$
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Timer(akka.actor.typed.javadsl.ActorContext<Timer.Protocol> context, Timer.CreateMsg msg)
Private constructor called only by CreateMsg.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
countdown(int milliseconds)
Timer waits for some time.static akka.actor.typed.Behavior<Timer.Protocol>
create(Timer.CreateMsg msg)
Public method that calls private constructor.akka.actor.typed.javadsl.Receive<Timer.Protocol>
createReceive()
Main method controlling incoming messages.-
Methods inherited from class akka.actor.typed.javadsl.AbstractBehavior
getContext, newReceiveBuilder, receive, receiveSignal
-
-
-
-
Constructor Detail
-
Timer
private Timer(akka.actor.typed.javadsl.ActorContext<Timer.Protocol> context, Timer.CreateMsg msg)
Private constructor called only by CreateMsg.
-
-
Method Detail
-
create
public static akka.actor.typed.Behavior<Timer.Protocol> create(Timer.CreateMsg msg)
Public method that calls private constructor. Existence required by Akka.- Returns:
- wrapped Behavior
-
createReceive
public akka.actor.typed.javadsl.Receive<Timer.Protocol> createReceive()
Main method controlling incoming messages. Existence required by Akka.- Specified by:
createReceive
in classakka.actor.typed.javadsl.AbstractBehavior<Timer.Protocol>
- Returns:
- wrapped Behavior
-
countdown
private void countdown(int milliseconds)
Timer waits for some time.
-
-