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

Add new create builder overloads without callbacks #366

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

jviau
Copy link
Member

@jviau jviau commented Jan 24, 2025

This PR introduces new create builder overloads for the client and worker with a slight difference. The existing overloads all take in a callback to configure the builder. The new overloads return the builder. This allows for a slightly cleaner HostApplicationBuilder experience. Some samples have also been updated to use HostApplicationBuilder and the new overloads.

Current style:

services.AddDurableTaskWorker(b =>
{ 
    b.Configure(...);
    b.AddTasks(...);
    b.UseGrpc();
});

New style:

services.AddDurableTaskWorker()
    .Configure(...)
    .AddTasks(...)
    .UseGrpc();

@jviau jviau requested a review from cgillum January 24, 2025 18:04
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

LGTM. Glad to have this simplified setup experience. Thanks!

@jviau jviau merged commit 2ff37c5 into microsoft:main Jan 24, 2025
4 checks passed
@jviau jviau deleted the app-builder branch January 24, 2025 21:39
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.

2 participants