Interface Scheduler

All Superinterfaces:
Monitorable
All Known Implementing Classes:
RemoteScheduler, SimpleScheduler

public interface Scheduler
extends Monitorable
Scheduler manages scheduling of actors to threads. As kontraktor 3.0 simplyfies scheduling compared to 2.0, this class currently doesn't do a lot.
  • Method Details

    • getDefaultQSize

      int getDefaultQSize()
    • pollDelay

      void pollDelay​(int count)
    • put2QueuePolling

      void put2QueuePolling​(java.util.Queue q, boolean isCBQ, java.lang.Object o, java.lang.Object sender)
    • enqueueCall

      java.lang.Object enqueueCall​(Actor sendingActor, Actor receiver, java.lang.String methodName, java.lang.Object[] args, boolean isCB)
    • enqueueCall

      java.lang.Object enqueueCall​(ConnectionRegistry reg, Actor sendingActor, Actor receiver, java.lang.String methodName, java.lang.Object[] args, boolean isCB)
    • enqueueCallFromRemote

      java.lang.Object enqueueCallFromRemote​(ConnectionRegistry reg, Actor sendingActor, Actor receiver, java.lang.String methodName, java.lang.Object[] args, boolean isCB, java.lang.Object securityContext, java.util.function.BiFunction<Actor,​java.lang.String,​java.lang.Boolean> callInterceptor, RemoteCallEntry remoteCallEntry)
      Warning: side effects on RCE transient to pass Method object from lookup up the calling hierarchy
      Parameters:
      reg -
      sendingActor -
      receiver -
      methodName -
      args -
      isCB -
      securityContext -
      callInterceptor -
      remoteCallEntry -
      Returns:
    • threadStopped

      void threadStopped​(DispatcherThread th)
    • terminateIfIdle

      void terminateIfIdle()
    • getInvoker

      java.lang.reflect.InvocationHandler getInvoker​(Actor dispatcher, java.lang.Object toWrap)
    • inThread

      <T> T inThread​(Actor actor, T callback)
      Creates a wrapper on the given object enqueuing all calls to INTERFACE methods of the given object to the given actors's queue. This is used to enable processing of resulting callback's in the callers thread. see also @InThread annotation.
      Type Parameters:
      T -
      Parameters:
      callback -
      Returns:
    • delayedCall

      void delayedCall​(long millis, java.lang.Runnable toRun)
    • runBlockingCall

      <T> void runBlockingCall​(Actor emitter, java.util.concurrent.Callable<T> toCall, Callback<T> resultHandler)
    • assignDispatcher

      DispatcherThread assignDispatcher​(int minLoadPerc)
    • rebalance

      void rebalance​(DispatcherThread dispatcherThread)
      called from inside overloaded thread with load all actors assigned to the calling thread therefore can be safely moved
      Parameters:
      dispatcherThread -
    • getBackoffStrategy

      BackOffStrategy getBackoffStrategy()
    • tryStopThread

      void tryStopThread​(DispatcherThread dispatcherThread)
    • tryIsolate

      void tryIsolate​(DispatcherThread dp, Actor actorRef)
    • getNumActors

      int getNumActors()
      Returns:
      number of actors scheduled by this scheduler. Note this is not precise as not thread safe'd.
    • mapResult

      java.lang.Object mapResult​(java.lang.Object result, RemoteCallEntry rce)
      maps a JsonMapped result of a promise in case
      Parameters:
      result -
      Returns: