Skip to content

Commit

Permalink
Doc/README updates (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz authored Feb 12, 2024
1 parent 79104b6 commit bfe4b3a
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 14 deletions.
44 changes: 30 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,13 @@ public async Task WaitADayWorkflow_SimpleRun_Succeeds()
env.Client,
new TemporalWorkerOptions($"task-queue-{Guid.NewGuid()}").
AddWorkflow<WaitADayWorkflow>());
var result = await env.Client.ExecuteWorkflowAsync(
(WaitADayWorkflow wf) => wf.RunAsync(),
new(id: $"wf-{Guid.NewGuid()}", taskQueue: worker.Options.TaskQueue!));
Assert.Equal("all done", result);
await worker.ExecuteAsync(async () =>
{
var result = await env.Client.ExecuteWorkflowAsync(
(WaitADayWorkflow wf) => wf.RunAsync(),
new(id: $"wf-{Guid.NewGuid()}", taskQueue: worker.Options.TaskQueue!));
Assert.Equal("all done", result);
});
}
```

Expand Down Expand Up @@ -858,11 +861,14 @@ public async Task SignalWorkflow_SendSignal_HasExpectedResult()
env.Client,
new TemporalWorkerOptions($"task-queue-{Guid.NewGuid()}").
AddWorkflow<SignalWorkflow>());
var handle = await env.Client.StartWorkflowAsync(
(SignalWorkflow wf) => wf.RunAsync(),
new(id: $"wf-{Guid.NewGuid()}", taskQueue: worker.Options.TaskQueue!));
await handle.SignalAsync(wf => wf.SomeSignalAsync());
Assert.Equal("got signal", await handle.GetResultAsync());
await worker.ExecuteAsync(async () =>
{
var handle = await env.Client.StartWorkflowAsync(
(SignalWorkflow wf) => wf.RunAsync(),
new(id: $"wf-{Guid.NewGuid()}", taskQueue: worker.Options.TaskQueue!));
await handle.SignalAsync(wf => wf.SomeSignalAsync());
Assert.Equal("got signal", await handle.GetResultAsync());
});
}
```

Expand All @@ -880,11 +886,14 @@ public async Task SignalWorkflow_SignalTimeout_HasExpectedResult()
env.Client,
new TemporalWorkerOptions($"task-queue-{Guid.NewGuid()}").
AddWorkflow<SignalWorkflow>());
var handle = await env.Client.StartWorkflowAsync(
(SignalWorkflow wf) => wf.RunAsync(),
new(id: $"wf-{Guid.NewGuid()}", taskQueue: worker.Options.TaskQueue!));
await env.DelayAsync(TimeSpan.FromSeconds(50));
Assert.Equal("got timeout", await handle.GetResultAsync());
await worker.ExecuteAsync(async () =>
{
var handle = await env.Client.StartWorkflowAsync(
(SignalWorkflow wf) => wf.RunAsync(),
new(id: $"wf-{Guid.NewGuid()}", taskQueue: worker.Options.TaskQueue!));
await env.DelayAsync(TimeSpan.FromSeconds(50));
Assert.Equal("got timeout", await handle.GetResultAsync());
});
}
```

Expand Down Expand Up @@ -1074,6 +1083,13 @@ not include this runtime. If not available, users may have to manually copy this
`vcruntime140.dll`), depend on a NuGet package that has it, or install the Visual C++ runtime (often via Visual C++
Redistributable installation).

If the native shared library is not loading for whatever reason, the following error may appear:

> System.DllNotFoundException: Unable to load DLL 'temporal_sdk_bridge' or one of its dependencies: The specified module
could not be found.

See the earlier part of this section for details on what environments are supported.

## Development

### Build
Expand Down
4 changes: 4 additions & 0 deletions src/Temporalio/Client/ITemporalClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ namespace Temporalio.Client
/// <summary>
/// Interface to a client to Temporal.
/// </summary>
/// <remarks>
/// Clients are thread-safe and are encouraged to be reused to properly reuse the underlying
/// connection.
/// </remarks>
/// <seealso cref="TemporalClient" />
public partial interface ITemporalClient : Worker.IWorkerClient
{
Expand Down
3 changes: 3 additions & 0 deletions src/Temporalio/Client/ITemporalConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ namespace Temporalio.Client
/// <summary>
/// Interface to a connection to Temporal.
/// </summary>
/// <remarks>
/// Connections are thread-safe and are encouraged to be reused.
/// </remarks>
/// <seealso cref="TemporalConnection" />
public interface ITemporalConnection : IBridgeClientProvider
{
Expand Down
4 changes: 4 additions & 0 deletions src/Temporalio/Client/TemporalClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ namespace Temporalio.Client
/// <summary>
/// Client for a Temporal namespace.
/// </summary>
/// <remarks>
/// Clients are thread-safe and are encouraged to be reused to properly reuse the underlying
/// connection.
/// </remarks>
public partial class TemporalClient : ITemporalClient
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/Temporalio/Client/TemporalConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ namespace Temporalio.Client
/// <summary>
/// Connection to Temporal.
/// </summary>
/// <remarks>
/// Connections are thread-safe and are encouraged to be reused.
/// </remarks>
public sealed class TemporalConnection : ITemporalConnection
{
// Not set if not lazy
Expand Down
Loading

0 comments on commit bfe4b3a

Please sign in to comment.