Skip to content

Commit

Permalink
Updated readme. Consistent case for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rross committed Jul 30, 2024
1 parent ca90698 commit 7ac67a9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/CounterInterceptor/MyWorkflow.workflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace TemporalioSamples.CounterInterceptor;
[Workflow]
public class MyWorkflow
{
private bool exit; // automatically defaults to false
private bool exit; // Automatically defaults to false

[WorkflowRun]
public async Task<string> RunAsync()
{
// wait for greeting info
// Wait for greeting info
await Workflow.WaitConditionAsync(() => Name != null && Title != null);

// Execute Child Workflow
Expand Down
6 changes: 3 additions & 3 deletions src/CounterInterceptor/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# dotnet-counter-interceptor
The sample demonstrates:
- the use of a simple Worker Workflow Interceptor that counts the number of Workflow Executions, Child Workflow Executions, and Activity Executions as well as the number of Signals and Queries. It is based
off of the [Java Sample](https://github.com/temporalio/samples-java/tree/main) located [here](https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/countinterceptor)
- the use of a simple Client Workflow Interceptor that counts the number of Workflow Executions as well as the number of Signals and Queries.
- the use of a Worker Workflow Interceptor that counts the number of Workflow Executions, Child Workflow Executions, and Activity Executions and the number of Signals and Queries. It is based
off of the [Java sample](https://github.com/temporalio/samples-java/tree/main) located [here](https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/countinterceptor)
- the use of a Client Workflow Interceptor that counts the number of Workflow Executions and the number of Signals and Queries.

## Start local Temporal Server
```bash
Expand Down
2 changes: 1 addition & 1 deletion src/CounterInterceptor/SimpleClientCallsInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override Task<TResult> QueryWorkflowAsync<TResult>(QueryWorkflowInput inp
public override Task<WorkflowUpdateHandle<TResult>> StartWorkflowUpdateAsync<TResult>(
StartWorkflowUpdateInput input)
{
// not tracking this
// Not tracking this
return base.StartWorkflowUpdateAsync<TResult>(input);
}

Expand Down
10 changes: 5 additions & 5 deletions tests/CounterInterceptor/MyWorkflowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public async Task RunAsync_CounterInterceptor()
{
await using var env = await WorkflowEnvironment.StartLocalAsync();

// add the interceptor to the client
// Add the interceptor to the client
var clientOptions = (TemporalClientOptions)env.Client.Options.Clone();
clientOptions.Interceptors = new[]
{
Expand Down Expand Up @@ -49,27 +49,27 @@ await worker.ExecuteAsync(async () =>
var name = await handle.QueryAsync(wf => wf.Name);
var title = await handle.QueryAsync(wf => wf.Title);

// send exit signal to workflow
// Send exit signal to workflow
await handle.SignalAsync(wf => wf.ExitAsync());

// Wait for the workflow to complete
var result = await handle.GetResultAsync();

// validate that the worker counters have the correct numbers for the parent
// Validate that the worker counters have the correct numbers for the parent
Assert.Equal(1U, WorkerCounter.NumOfWorkflowExecutions(parentWorkflowId));
Assert.Equal(1U, WorkerCounter.NumOfChildWorkflowExecutions(parentWorkflowId));
Assert.Equal(0U, WorkerCounter.NumOfActivityExecutions(parentWorkflowId));
Assert.Equal(2U, WorkerCounter.NumOfSignals(parentWorkflowId));
Assert.Equal(2U, WorkerCounter.NumOfQueries(parentWorkflowId));

// validate the worker counters have the correct numbers for the child
// Validate the worker counters have the correct numbers for the child
Assert.Equal(1U, WorkerCounter.NumOfWorkflowExecutions(childWorkflowId));
Assert.Equal(0U, WorkerCounter.NumOfChildWorkflowExecutions(childWorkflowId));
Assert.Equal(2U, WorkerCounter.NumOfActivityExecutions(childWorkflowId));
Assert.Equal(0U, WorkerCounter.NumOfSignals(childWorkflowId));
Assert.Equal(0U, WorkerCounter.NumOfQueries(childWorkflowId));

// validate the client counters have correct numbers
// Validate the client counters have correct numbers
Assert.Equal(1U, ClientCounter.NumOfWorkflowExecutions(parentWorkflowId));
Assert.Equal(2U, ClientCounter.NumOfSignals(parentWorkflowId));
Assert.Equal(2U, ClientCounter.NumOfQueries(parentWorkflowId));
Expand Down

0 comments on commit 7ac67a9

Please sign in to comment.