private static final class ZActor.Double extends java.lang.Object implements ZPoller.EventsHandler, ZStar.Star
Modifier and Type | Field and Description |
---|---|
private ZActor.Actor |
actor |
private ZContext |
context |
private ZMQ.Socket |
pipe |
private ZPoller |
poller |
private java.util.List<ZMQ.Socket> |
sockets |
Constructor and Description |
---|
Double(ZContext ctx,
ZMQ.Socket pipe,
ZActor.Actor actor,
java.lang.Object... args) |
Modifier and Type | Method and Description |
---|---|
boolean |
act(int events)
Where acting takes place ...
Hint: Can be used to process the events or input acquired from the previous step, or ... Key point: in the middle of a loop. Decision: to act on the next loop or not |
int |
breathe()
Called when the star in on stage, just before acting.
Hint: Can be used to poll events or get input/events from other sources, or ... Key point: a loop just started. |
boolean |
entract()
Called as an interval between each act.
Hint: Can be used to perform decisions to continue next loop or not, or to send computed data to outputs, or ... Key point: at the end of a loop. Decision: to act on the next loop or not |
boolean |
events(java.nio.channels.SelectableChannel channel,
int events)
Called when the poller intercepts events.
|
boolean |
events(ZMQ.Socket socket,
int events)
Called when the poller intercepts events.
|
void |
prepare()
Called when the star is in the wings.
Hint: Can be used to initialize the service, or ... Key point: no loop has started already. |
boolean |
renews()
Does the star want to renew for a new performance ?
Hint: Can be used to perform decisions to continue looping or not, or to send computed data to outputs, or ...
Key point: the inner looping mechanism just ended Decision: to exit or not |
private final ZPoller poller
private final ZMQ.Socket pipe
private final java.util.List<ZMQ.Socket> sockets
private final ZActor.Actor actor
private final ZContext context
public Double(ZContext ctx, ZMQ.Socket pipe, ZActor.Actor actor, java.lang.Object... args)
public void prepare()
ZStar.Star
prepare
in interface ZStar.Star
public int breathe()
ZStar.Star
breathe
in interface ZStar.Star
public boolean act(int events)
ZStar.Star
act
in interface ZStar.Star
events
- the number of events to processpublic boolean entract()
ZStar.Star
entract
in interface ZStar.Star
public boolean renews()
ZStar.Star
renews
in interface ZStar.Star
public boolean events(java.nio.channels.SelectableChannel channel, int events)
ZPoller.EventsHandler
events
in interface ZPoller.EventsHandler
channel
- the channel with eventsevents
- the interesting events as an ORed combination of IN, OUT, ERRpublic boolean events(ZMQ.Socket socket, int events)
ZPoller.EventsHandler
events
in interface ZPoller.EventsHandler
socket
- the socket with eventsevents
- the interesting events as an ORed combination of IN, OUT, ERR