Package com.uber.cadence.activity
Class ActivityOptions.Builder
- java.lang.Object
-
- com.uber.cadence.activity.ActivityOptions.Builder
-
- Enclosing class:
- ActivityOptions
public static final class ActivityOptions.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(ActivityOptions options)
Copy Builder fields from the options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActivityOptions
build()
ActivityOptions.Builder
setContextPropagators(java.util.List<ContextPropagator> contextPropagators)
ContextPropagators help propagate the context from the workflow to the activitiesActivityOptions.Builder
setHeartbeatTimeout(java.time.Duration heartbeatTimeoutSeconds)
Heartbeat interval.ActivityOptions.Builder
setRetryOptions(RetryOptions retryOptions)
RetryOptions that define how activity is retried in case of failure.ActivityOptions.Builder
setScheduleToCloseTimeout(java.time.Duration scheduleToCloseTimeout)
Overall timeout workflow is willing to wait for activity to complete.ActivityOptions.Builder
setScheduleToStartTimeout(java.time.Duration scheduleToStartTimeout)
Time activity can stay in task list before it is picked up by a worker.ActivityOptions.Builder
setStartToCloseTimeout(java.time.Duration startToCloseTimeout)
Maximum activity execution time after it was sent to a worker.ActivityOptions.Builder
setTaskList(java.lang.String taskList)
Task list to use when dispatching activity task to a worker.ActivityOptions
validateAndBuildWithDefaults()
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(ActivityOptions options)
Copy Builder fields from the options.
-
-
Method Detail
-
setScheduleToCloseTimeout
public ActivityOptions.Builder setScheduleToCloseTimeout(java.time.Duration scheduleToCloseTimeout)
Overall timeout workflow is willing to wait for activity to complete. It includes time in a task list (usesetScheduleToStartTimeout(Duration)
to limit it) plus activity execution time (usesetStartToCloseTimeout(Duration)
to limit it). Either this option or both schedule to start and start to close are required.
-
setScheduleToStartTimeout
public ActivityOptions.Builder setScheduleToStartTimeout(java.time.Duration scheduleToStartTimeout)
Time activity can stay in task list before it is picked up by a worker. If schedule to close is not provided then both this and start to close are required.
-
setStartToCloseTimeout
public ActivityOptions.Builder setStartToCloseTimeout(java.time.Duration startToCloseTimeout)
Maximum activity execution time after it was sent to a worker. If schedule to close is not provided then both this and schedule to start are required.
-
setHeartbeatTimeout
public ActivityOptions.Builder setHeartbeatTimeout(java.time.Duration heartbeatTimeoutSeconds)
Heartbeat interval. Activity must heartbeat before this interval passes after a last heartbeat or activity start.
-
setTaskList
public ActivityOptions.Builder setTaskList(java.lang.String taskList)
Task list to use when dispatching activity task to a worker. By default it is the same task list name the workflow was started with.
-
setRetryOptions
public ActivityOptions.Builder setRetryOptions(RetryOptions retryOptions)
RetryOptions that define how activity is retried in case of failure. Default is null which is no reties.
-
setContextPropagators
public ActivityOptions.Builder setContextPropagators(java.util.List<ContextPropagator> contextPropagators)
ContextPropagators help propagate the context from the workflow to the activities
-
build
public ActivityOptions build()
-
validateAndBuildWithDefaults
public ActivityOptions validateAndBuildWithDefaults()
-
-