-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: add DomainEvent activity #5994
base: main
Are you sure you want to change the base?
feat: add DomainEvent activity #5994
Conversation
@dotnet-policy-service agree |
Would it make sense to use INotificationSender instead of IWebhookDispatcher? |
This was added to provide feature parity with the RunTask and I thought this was just a default notification handler, but what would be the reason for this additional indirection of a notification publishing another notification? |
I was more thinking that we want to be able to publish domain events, which are "lower-level" than webhook events. Ergo, it doesn't make sense to me to use a service called "webhook dispatcher" when it has nothing to do with webhooks. For that reason, I'm thinking that using INoticationSender is more suitable. The webhook dispatcher uses this too under the hood. Alternatively, we could consider adding a new service called e.g. |
But the activity execution is already publishing a the domain event as notification using INotificationSender (this could be chanced to consume a IDomainEventDispatcher, yes) but the current handler is just a default implementation of the notification handler like for RunTask. If required, it is still possible to implement a custom handler and handle the domain event with custom logic |
66cc646
to
31e8b94
Compare
I've added a IDomainEventDispatcher with both a background and synchronous implementation, and exposed a factory in WorfklowsRuntimeFeature just like for the ITaskDispatcher, then updated the handler under webhook. |
Hi @cfgiugliano, thank you for all the nice work! I need more time to go through the PR, but I'll offer som initial thoughts.
I think this would reduce some redundancy while still being able to deliver events to webhook sinks.
A potential benefits of this specialized API might be:
And perhaps we could have both. It's nice to have options. |
This adds the DomainEvent activity as proposed in #5583
This change is