Skip to content

Commit

Permalink
feat(dotnet-sdk): Add param to worker method and fix readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlaCarvajal committed Dec 5, 2024
1 parent 5bcaaf5 commit 4499dcf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion sdk-dotnet/Examples/WorkerContextExample/MyWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ namespace WorkerContextExample;
public class MyWorker
{
[LHTaskMethod("task")]
public void ProcessTask(LHWorkerContext context)
public void ProcessTask(long requestTime, LHWorkerContext context)
{
context.Log("ProcessPayment");
Console.WriteLine($"Processing request time: {requestTime}");
Console.WriteLine($"The Workflow Run Id is: {context.GetWfRunId()}");
Console.WriteLine($"The Node Run Id is: {context.GetNodeRunId()}");
Console.WriteLine($"The Task Run Id is: {context.GetTaskRunId()}");
Expand Down
5 changes: 4 additions & 1 deletion sdk-dotnet/LittleHorse.Sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ brew install dotnet
### Build

```
cd sdk-dotnet/LittleHorse.Sdk
cd sdk-dotnet
dotnet build ./LittleHorse.Sdk
```
### Build and Run tests
Expand All @@ -45,6 +45,9 @@ dotnet test ./LittleHorse.Sdk.Tests

```
dotnet run --project ./Examples/BasicExample
dotnet run --project ./Examples/ExceptionsHandlerExample
dotnet run --project ./Examples/MaskedFieldsExample
dotnet run --project ./Examples/WorkerContextExample
```

### Self-signed TLS certificate
Expand Down
7 changes: 5 additions & 2 deletions sdk-dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ brew install dotnet
### Build

```
cd sdk-dotnet/LittleHorse.Sdk
cd sdk-dotnet
dotnet build ./LittleHorse.Sdk
```
### Build and Run tests
Expand All @@ -41,10 +41,13 @@ dotnet build ./LittleHorse.Sdk
dotnet test ./LittleHorse.Sdk.Tests
```

### Run Example
### Run Examples

```
dotnet run --project ./Examples/BasicExample
dotnet run --project ./Examples/ExceptionsHandlerExample
dotnet run --project ./Examples/MaskedFieldsExample
dotnet run --project ./Examples/WorkerContextExample
```

### Self-signed TLS certificate
Expand Down

0 comments on commit 4499dcf

Please sign in to comment.