-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dotnet-sdk): add readme file in example
- Loading branch information
1 parent
a6e0704
commit 1cabe89
Showing
3 changed files
with
48 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## Running WorkerContextExample | ||
|
||
This example shows how to get access to the context when executing a task. | ||
Go to the class `MyWorker`. | ||
|
||
Let's run the example in `WorkerContextExample` | ||
|
||
``` | ||
dotnet build | ||
dotnet run | ||
``` | ||
|
||
In another terminal, use `lhctl` to run the workflow: | ||
|
||
``` | ||
lhctl run example-worker-context | ||
``` | ||
|
||
In addition, you can check the result with: | ||
|
||
``` | ||
# This call shows the result | ||
lhctl get wfRun <wf_run_id> | ||
# This will show you all nodes in tha run | ||
lhctl list nodeRun <wf_run_id> | ||
# This shows the task run information | ||
lhctl get taskRun <wf_run_id> <task_run_global_id> | ||
``` | ||
|
||
## Considerations | ||
|
||
If you need get access to the context you have to add a `LHWorkerContext` | ||
parameter to the signature of your task: | ||
|
||
``` | ||
[LHTaskMethod("task")] | ||
public void ProcessTask(LHWorkerContext context) | ||
{ | ||
... | ||
} | ||
``` | ||
|
||
The `WorkerContext` should be the last parameter. |