public class Invoker extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Invoker.DirectInvocation
A direct invocation (in the same thread than caller)
|
static class |
Invoker.Invocation
An Invocation in something to run in a Play!
|
static class |
Invoker.InvocationContext
The class/method that will be invoked by the current operation
|
static class |
Invoker.Suspend
Throwable to indicate that the request must be suspended
|
Modifier and Type | Field and Description |
---|---|
static ScheduledThreadPoolExecutor |
executor
Main executor for requests invocations.
|
Constructor and Description |
---|
Invoker() |
Modifier and Type | Method and Description |
---|---|
static Future<?> |
invoke(Invoker.Invocation invocation)
Run the code in a new thread took from a thread pool.
|
static Future<?> |
invoke(Invoker.Invocation invocation,
long millis)
Run the code in a new thread after a delay
|
static void |
invokeInThread(Invoker.DirectInvocation invocation)
Run the code in the same thread than caller.
|
public static ScheduledThreadPoolExecutor executor
public static Future<?> invoke(Invoker.Invocation invocation)
invocation
- The code to runpublic static Future<?> invoke(Invoker.Invocation invocation, long millis)
invocation
- The code to runmillis
- The time to wait before, in millisecondspublic static void invokeInThread(Invoker.DirectInvocation invocation)
invocation
- The code to runGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly