Package org.nustaq.kontraktor
Interface Scheduler
- All Superinterfaces:
Monitorable
- All Known Implementing Classes:
RemoteScheduler,SimpleScheduler
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 Summary
Modifier and TypeMethodDescriptionassignDispatcher(int minLoadPerc) voiddelayedCall(long millis, Runnable toRun) enqueueCall(Actor sendingActor, Actor receiver, String methodName, Object[] args, boolean isCB) enqueueCall(ConnectionRegistry reg, Actor sendingActor, Actor receiver, String methodName, Object[] args, boolean isCB) enqueueCallFromRemote(ConnectionRegistry reg, Actor sendingActor, Actor receiver, String methodName, Object[] args, boolean isCB, Object securityContext, BiFunction<Actor, String, Boolean> callInterceptor, RemoteCallEntry remoteCallEntry) Warning: side effects on RCE transient to pass Method object from lookup up the calling hierarchyintgetInvoker(Actor dispatcher, Object toWrap) int<T> TCreates a wrapper on the given object enqueuing all calls to INTERFACE methods of the given object to the given actors's queue.mapResult(Object result, RemoteCallEntry rce) maps a JsonMapped result of a promise in casevoidpollDelay(int count) voidput2QueuePolling(Queue q, boolean isCBQ, Object o, Object sender) voidrebalance(DispatcherThread dispatcherThread) called from inside overloaded thread with load all actors assigned to the calling thread therefore can be safely moved<T> voidrunBlockingCall(Actor emitter, Callable<T> toCall, Callback<T> resultHandler) voidvoidvoidtryIsolate(DispatcherThread dp, Actor actorRef) voidtryStopThread(DispatcherThread dispatcherThread) Methods inherited from interface org.nustaq.kontraktor.monitoring.Monitorable
getReport, getSubMonitorables
-
Method Details
-
getDefaultQSize
int getDefaultQSize() -
pollDelay
void pollDelay(int count) -
put2QueuePolling
-
enqueueCall
-
enqueueCall
-
enqueueCallFromRemote
Object enqueueCallFromRemote(ConnectionRegistry reg, Actor sendingActor, Actor receiver, String methodName, Object[] args, boolean isCB, Object securityContext, BiFunction<Actor, String, 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
-
terminateIfIdle
void terminateIfIdle() -
getInvoker
-
inThread
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
-
runBlockingCall
-
assignDispatcher
-
rebalance
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
-
tryIsolate
-
getNumActors
int getNumActors()- Returns:
- number of actors scheduled by this scheduler. Note this is not precise as not thread safe'd.
-
mapResult
maps a JsonMapped result of a promise in case- Parameters:
result-- Returns:
-