Class RemoteRefPolling

java.lang.Object
org.nustaq.kontraktor.remoting.base.RemoteRefPolling
All Implemented Interfaces:
Runnable

public class RemoteRefPolling extends Object implements 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)
  • 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

      public IPromise scheduleSendLoop(ConnectionRegistry reg)
      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:
      run in interface Runnable
    • onePoll

      protected int onePoll()
    • terminateEntry

      protected void terminateEntry(int i, RemoteRefPolling.ScheduleEntry entry, Object res, Throwable e)