Package io.temporal.worker
Class WorkflowTaskDispatchHandle
- java.lang.Object
-
- io.temporal.worker.WorkflowTaskDispatchHandle
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class WorkflowTaskDispatchHandle extends java.lang.Object implements java.io.Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
WorkflowTaskDispatchHandle.DispatchCallback
A callback into aWorkflowWorker
to dispatch a workflow task
-
Constructor Summary
Constructors Constructor Description WorkflowTaskDispatchHandle(WorkflowTaskDispatchHandle.DispatchCallback dispatchCallback, java.util.concurrent.Semaphore executorSlotsSemaphore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
dispatch(io.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse workflowTask)
-
-
-
Constructor Detail
-
WorkflowTaskDispatchHandle
public WorkflowTaskDispatchHandle(WorkflowTaskDispatchHandle.DispatchCallback dispatchCallback, java.util.concurrent.Semaphore executorSlotsSemaphore)
- Parameters:
dispatchCallback
- callback into aWorkflowWorker
to dispatch a workflow task.executorSlotsSemaphore
- worker executor slots semaphore that was used to reserve this dispatch handle on
-
-
Method Detail
-
dispatch
public boolean dispatch(@Nonnull io.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse workflowTask)
- Parameters:
workflowTask
- to be fed directly into the workflow worker- Returns:
- true is the workflow task was successfully dispatched
- Throws:
java.lang.IllegalArgumentException
- if the workflow task doesn't belong to the task queue of the worker provided thisWorkflowTaskDispatchHandle
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-