-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also test sched2close timeout & add .net
- Loading branch information
1 parent
948553f
commit 82c38dd
Showing
5 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
namespace activity.basic_no_workflow_timeout; | ||
|
||
using Temporalio.Activities; | ||
using Temporalio.Client; | ||
using Temporalio.Exceptions; | ||
using Temporalio.Features.Harness; | ||
using Temporalio.Worker; | ||
using Temporalio.Workflows; | ||
|
||
class Feature : IFeature | ||
{ | ||
public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) => | ||
options.AddWorkflow<MyWorkflow>().AddAllActivities(new MyActivities(runner.Client)); | ||
|
||
[Workflow] | ||
class MyWorkflow | ||
{ | ||
private string? activityResult; | ||
|
||
[WorkflowRun] | ||
public async Task RunAsync() | ||
{ | ||
await Workflow.ExecuteActivityAsync( | ||
(MyActivities act) => act.Echo(), | ||
new() | ||
{ | ||
ScheduleToCloseTimeout = TimeSpan.FromMinutes(1) | ||
}); | ||
|
||
await Workflow.ExecuteActivityAsync( | ||
(MyActivities act) => act.Echo(), | ||
new() | ||
{ | ||
StartToCloseTimeout = TimeSpan.FromMinutes(1) | ||
}); | ||
} | ||
|
||
[WorkflowSignal] | ||
public async Task SetActivityResultAsync(string res) => activityResult = res; | ||
} | ||
|
||
class MyActivities | ||
{ | ||
private readonly ITemporalClient client; | ||
|
||
public MyActivities(ITemporalClient client) => this.client = client; | ||
|
||
[Activity] | ||
public async Task<string> Echo() | ||
{ | ||
return "hi"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters