Skip to content
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

Lazy clients, client DI, and expose client health check #98

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

cretz
Copy link
Member

@cretz cretz commented Jul 3, 2023

What was changed

  • Added TemporalClient.CreateLazy and TemporalConnection.CreateLazy for those wanting to create client but not connect until later
  • Added ITemporalConnection.IsConnected property and ITemporalConnection.ConnectAsync instance method to support lazy connections
  • Added IServiceCollection.AddTemporalClient extension methods for creating DI-based lazy singleton client (one returns an option builder, the other accepts an action to configure)
  • Added gRPC health check and supporting gRPC messages

@cretz cretz requested a review from a team July 3, 2023 19:11
@cretz cretz mentioned this pull request Jul 3, 2023
@mrtristan
Copy link

looks good, thanks!

@cretz
Copy link
Member Author

cretz commented Jul 5, 2023

Note, I cannot merge this until I have released the existing in-limbo packages (there is a NuGet bug holding this up).

@alrz
Copy link

alrz commented Jul 11, 2023

Note, I cannot merge this until I have released the existing in-limbo packages (there is a NuGet bug holding this up).

I suppose you're referring to hosting/otel packages, any eta on releasing those to nugetorg? Is there an issue tracking nuget bug?

@cretz
Copy link
Member Author

cretz commented Jul 11, 2023

I suppose you're referring to hosting/otel packages, any eta on releasing those to nugetorg? Is there an issue tracking nuget bug?

Hopefully soon, no ETA.

@@ -12,13 +17,14 @@ namespace Temporalio.Client
/// </summary>
public sealed class TemporalConnection : ITemporalConnection
{
private readonly Bridge.Client client;
// Not set if not lazy
private readonly SemaphoreSlim? semaphoreForLazyClient;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SemaphoreSlim sounds like a great rapper name

@cretz cretz merged commit 52d6868 into temporalio:main Jul 18, 2023
@cretz cretz deleted the client-di branch July 18, 2023 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants