-
Notifications
You must be signed in to change notification settings - Fork 61
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 API hook when bus is started but messages are not yet being delivered #87
Conversation
src/Abc.Zebus.Tests/Dispatch/DispatchMessages/ExecutableEvent.cs
Outdated
Show resolved
Hide resolved
@@ -30,11 +31,12 @@ public class DispatchQueue : IDisposable | |||
|
|||
internal SynchronizationContext SynchronizationContext { get; } | |||
|
|||
public DispatchQueue(IPipeManager pipeManager, int batchSize, string name) | |||
public DispatchQueue(IPipeManager pipeManager, int batchSize, string name, TimeSpan timeToWaitForInitialization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a timeout? That seems dangerous as you won't be able to assume the bus is not processing the received messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as not to completely block the start-up of the Bus if one of the initialisers is blocked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer it to block, so it doesn't go undetected. @ocoanet what do you think?
@@ -14,6 +14,8 @@ public abstract class HostInitializer | |||
/// </summary> | |||
public virtual int Priority => 0; | |||
|
|||
public virtual bool CallAfterStartBeforeMessageDeliveryHasStarted => false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't a different function like AfterStartBeforeDispatch
be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered it but thought that it didn't really make sense to be able to override both at the same time and therefore we shouldn't give the user the option to do so. It also would make it easier to change the default behaviour for all our hosts at once if we are confident that the new time is better in all situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocoanet ?
Co-Authored-By: Lucas Trzesniewski <lucas.trzesniewski@gmail.com>
Co-Authored-By: Lucas Trzesniewski <lucas.trzesniewski@gmail.com>
@ocoanet, do you want to have a look at the open comments on this PR or should we merge it? |
…-delivering-api-hook # Conflicts: # azure-pipelines.yml
Resolves #86