Class RemoteRefPolling
java.lang.Object
org.nustaq.kontraktor.remoting.base.RemoteRefPolling
- All Implemented Interfaces:
java.lang.Runnable
public class RemoteRefPolling
extends java.lang.Object
implements java.lang.Runnable
polls queues of remote actor proxies and serializes messages to their associated object sockets.
Note for transparent websocket/longpoll reconnect:
Terminated / Disconnected remote actors (registries) are removed from the entry list,
so regular actor messages sent to a terminated remote actor queue up in its mailbox.
Callbacks/Future results from exported callbacks/futures still reach the object socket
as these are redirected directly inside serializers. Those queue up in the webobjectsocket's list,
as flush is not called anymore because of removement from SendLoop list.
In case of TCP remoting, an ActorStopped Exception is thrown if an attempt is made to send a message to a
disconnected remote actor.
in short: regular messages to disconected remote actors queue up in mailbox, callbacks in object socket buffer
For typical client/server alike use cases, there are never remote references as most client api's do
not support handing out client remoterefs to servers (javascript, kontraktor bare)
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteRefPolling.ScheduleEntry -
Field Summary
Fields Modifier and Type Field Description static longEMPTY_Q_BACKOFF_WAIT_MILLISstatic longNONE_CONNETCED_WAIT_MILLIS -
Constructor Summary
Constructors Constructor Description RemoteRefPolling() -
Method Summary
Modifier and Type Method Description protected intonePoll()voidrun()IPromisescheduleSendLoop(ConnectionRegistry reg)return a future which is completed upon connection closeprotected voidterminateEntry(int i, RemoteRefPolling.ScheduleEntry entry, java.lang.Object res, java.lang.Throwable e)
-
Field Details
-
EMPTY_Q_BACKOFF_WAIT_MILLIS
public static long EMPTY_Q_BACKOFF_WAIT_MILLIS -
NONE_CONNETCED_WAIT_MILLIS
public static long NONE_CONNETCED_WAIT_MILLIS
-
-
Constructor Details
-
RemoteRefPolling
public RemoteRefPolling()
-
-
Method Details
-
scheduleSendLoop
return a future which is completed upon connection close- Parameters:
reg-- Returns:
- future completed upon termination of scheduling (disconnect)
-
run
public void run()- Specified by:
runin interfacejava.lang.Runnable
-
onePoll
protected int onePoll() -
terminateEntry
protected void terminateEntry(int i, RemoteRefPolling.ScheduleEntry entry, java.lang.Object res, java.lang.Throwable e)
-