You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AddListener and AddListenerDispatch are always called together.
If you call AddListener alone, you only add this to a policy that isn't connected tot he dispatcher (and will never run)
If you call AddListenerDispatch alone, you aren't listening to the policy (even though the dispatcher is calling it) so you get no information.
I can't think of any reason why you'd call them alone.
Because of this, there should be a function or something that calls both just for ease of use for anyone learning how to use the dispatcher. EVEN if there is a reason to call one or the other separately, there should still be a function that does both, imo.
The text was updated successfully, but these errors were encountered:
They are time oriented. The Dispatch/NoDispatch are used for while the dispatcher is running. AddListener is for before dispatcher starts. AddListener is called by AddListenerDispatch.
Not sure need to add before running, as you can just use the constructor, I would say we maybe make AddListener/RemoveListener protected.
The point is that, from an outside viewer (someone unfamiliar), it's probably incredibly confusing (when do you call add, which one to call, what do you call add on and why?). Convenience functionality would likely lower learning curve. Or a very good explanation of the API somewhere.
I did get one thing wrong in the issue. When you aren't listening to another policy, only calling one makes sense. But when you are dealing with more than 1 policy, you have to deal with at least two add calls somewhere.
You can only use the template ctor if you're not going to customize using the policy ctor. Unless you're talking about something else, I can't tell.
AddListener and AddListenerDispatch are always called together.
If you call AddListener alone, you only add this to a policy that isn't connected tot he dispatcher (and will never run)
If you call AddListenerDispatch alone, you aren't listening to the policy (even though the dispatcher is calling it) so you get no information.
I can't think of any reason why you'd call them alone.
Because of this, there should be a function or something that calls both just for ease of use for anyone learning how to use the dispatcher. EVEN if there is a reason to call one or the other separately, there should still be a function that does both, imo.
The text was updated successfully, but these errors were encountered: