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

Added possibility to specify NotificationHandlingStrategy when sending notification #27

Closed
wants to merge 1 commit into from

Conversation

lkovalyk
Copy link

@lkovalyk lkovalyk commented Oct 3, 2022

By default I use sorted StopOnException strategy, but in some cases I have to handle notifications with ParallelWhenAll strategy to resolve performance problem.

@sizovs
Copy link
Owner

sizovs commented Oct 3, 2022

Hey @lkovalyk

Thanks for the PR. The current approach to multiple notification handling strategies is by setting up multiple instances of PipelinR – one per strategy. Currently, I am reluctant to merge the PR because:

  1. Handling an infrequent use case at the Pipeline level would make Pipeline interface heavier for everyone.
  2. When life allows, a single approach is better than multiple ones because it's easier to reason about and troubleshoot notification handling when it's configured in a single place.
  3. When life allows, it's good not to couple Pipeline – the client interface – with strategies and other "details."

That said, for your specific use case, you can create a separate PipelinR instance and override the notification strategy on that instance.

Would that solve your problem?

@lkovalyk
Copy link
Author

lkovalyk commented Oct 5, 2022

Hi @sizovs
Thx for the solution, and it solved my problem.

@sizovs sizovs closed this Oct 5, 2022
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.

None yet

2 participants