Skip to content

*ActivityOptions: make either timeout required #1523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions packages/common/src/activity-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ checkExtends<ActivityCancellationType, coresdk.workflow_commands.ActivityCancell
/**
* Options for remote activity invocation
*/
export interface ActivityOptions {
export type ActivityOptions = {
/**
* Identifier to use for tracking the activity in Workflow history.
* The `activityId` can be accessed by the activity function.
Expand Down Expand Up @@ -111,12 +111,20 @@ export interface ActivityOptions {
* @experimental
*/
versioningIntent?: VersioningIntent;
}
} & (
{
scheduleToCloseTimeout: Duration;
} |
{
startToCloseTimeout: Duration;
}
);


/**
* Options for local activity invocation
*/
export interface LocalActivityOptions {
export type LocalActivityOptions = {
/**
* RetryPolicy that defines how an activity is retried in case of failure. If this is not set, then the SDK-defined default activity retry policy will be used.
* Note that local activities are always executed at least once, even if maximum attempts is set to 1 due to Workflow task retries.
Expand Down Expand Up @@ -175,4 +183,11 @@ export interface LocalActivityOptions {
* - `ABANDON` - Do not request cancellation of the activity and immediately report cancellation to the workflow.
*/
cancellationType?: coresdk.workflow_commands.ActivityCancellationType;
}
} & (
{
scheduleToCloseTimeout: Duration;
} |
{
startToCloseTimeout: Duration;
}
);
Loading