public class Celery
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
Celery() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the program and performs cleanup.
|
void |
registerTask(java.lang.Object task)
Register a task object
|
void |
registeTask(java.lang.String task)
Add a task by string
|
java.util.concurrent.Future<AsyncResult> |
sendTask(java.lang.String taskName,
java.lang.Object[] args,
java.util.Map<java.lang.String,java.lang.Object> kwargs)
Send a task and await the result by name.
|
java.util.concurrent.Future<AsyncResult> |
sendTask(java.lang.String taskName,
java.lang.Object[] args,
java.util.Map<java.lang.String,java.lang.Object> kwargs,
java.lang.Long softTimeLimit,
long hardTimeLimit)
Send a task and await the result by name.
|
java.util.concurrent.Future<AsyncResult> |
sendTask(java.lang.String taskName,
java.lang.Object[] args,
java.util.Map<java.lang.String,java.lang.Object> kwargs,
java.lang.String correlationId,
int priority,
Task[] children,
Options options)
Send a task
|
java.util.concurrent.Future<AsyncResult> |
sendTask(java.lang.String taskName,
java.lang.Object[] args,
java.util.Map<java.lang.String,java.lang.Object> kwargs,
Task[] children)
Send a task and await the result by name.
|
void |
submit()
Submit a task using the class
|
public void submit()
public java.util.concurrent.Future<AsyncResult> sendTask(java.lang.String taskName, java.lang.Object[] args, java.util.Map<java.lang.String,java.lang.Object> kwargs, java.lang.String correlationId, int priority, Task[] children, Options options) throws BrokerSendTaskException, java.security.NoSuchAlgorithmException, java.security.KeyManagementException, java.net.URISyntaxException, java.lang.CloneNotSupportedException
taskName - The task nameargs - argumentskwargs - mapped argumentscorrelationId - correlation idpriority - prioritychildren - any child tasksoptions - Options for the taskBrokerSendTaskException - Thrown if send failsjava.security.NoSuchAlgorithmException - Thrown by getjava.security.KeyManagementException - Thrown by getjava.net.URISyntaxException - Thrown by sendtaskjava.lang.CloneNotSupportedException - Thrown when cloning configpublic java.util.concurrent.Future<AsyncResult> sendTask(java.lang.String taskName, java.lang.Object[] args, java.util.Map<java.lang.String,java.lang.Object> kwargs, Task[] children) throws java.lang.CloneNotSupportedException
taskName - The task nameargs - The argumentskwargs - The mapped argumentschildren - children arrayjava.lang.CloneNotSupportedException - Thrown when cloning configpublic java.util.concurrent.Future<AsyncResult> sendTask(java.lang.String taskName, java.lang.Object[] args, java.util.Map<java.lang.String,java.lang.Object> kwargs) throws java.lang.CloneNotSupportedException
taskName - The task nameargs - The argumentskwargs - The mapped argumentsjava.lang.CloneNotSupportedException - Thrown when cloning configpublic java.util.concurrent.Future<AsyncResult> sendTask(java.lang.String taskName, java.lang.Object[] args, java.util.Map<java.lang.String,java.lang.Object> kwargs, java.lang.Long softTimeLimit, long hardTimeLimit) throws java.lang.CloneNotSupportedException
taskName - The task nameargs - The argumentskwargs - The mapped argumentssoftTimeLimit - soft time limithardTimeLimit - The hard time limitjava.lang.CloneNotSupportedException - Thrown when cloning configpublic void registerTask(java.lang.Object task)
task - The task to registerpublic void registeTask(java.lang.String task)
task - The task name stringpublic void close()
close in interface java.lang.AutoCloseable