-
Notifications
You must be signed in to change notification settings - Fork 374
[docs] Add workflows to .NET client doc #1019
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
Changes from 4 commits
2d52c00
24b8450
49cc32e
0c22791
8e23b8e
dffa664
d6824ad
dbf6f68
b6f8cbc
dc1abfd
baf1a0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,12 +199,35 @@ await foreach (var items in subscribeConfigurationResponse.Source.WithCancellati | |
| } | ||
| ``` | ||
|
|
||
| ### Manage workflow instances (Alpha) | ||
|
|
||
| ```csharp | ||
| var daprClient = new DaprClientBuilder().Build(); | ||
|
|
||
| string instanceId; | ||
| string workflowComponentName; | ||
|
hhunter-ms marked this conversation as resolved.
Outdated
|
||
| string workflowName; | ||
|
hhunter-ms marked this conversation as resolved.
Outdated
|
||
| object input ; | ||
|
hhunter-ms marked this conversation as resolved.
Outdated
|
||
| Dictionary<string, string> workflowOptions; // This is an optional parameter | ||
| CancellationToken.None; | ||
|
hhunter-ms marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Start workflow | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. string instanceId; It might be helpful to add all of these above "//Start workflow" to give the user a better idea as to what variable types everything is.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't bother with a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, good point. In that case, let’s remove both the options variable and the cancellation token. |
||
| var startResponse = await daprClient.StartWorkflowAsync(instanceId, workflowComponent, workflowName, input, workflowOptions, cts); | ||
|
hhunter-ms marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Terminate workflow | ||
| await daprClient.TerminateWorkflowAsync(instanceId, workflowComponent); | ||
|
|
||
| // Get workflow metadata | ||
| var getResponse = await daprClient.GetWorkflowAsync(instanceId, workflowComponent, workflowName); | ||
| ``` | ||
|
|
||
| ## Sidecar APIs | ||
| ### Sidecar Health | ||
| The .NET SDK provides a way to poll for the sidecar health, as well as a convenience method to wait for the sidecar to be ready. | ||
|
|
||
| #### Poll for health | ||
| This health endpoint returns true when both the sidecar and your application are up (fully initialized). | ||
|
|
||
| ```csharp | ||
| var client = new DaprClientBuilder().Build(); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.