coravel
coravel copied to clipboard
Broadcast fallback not working with multiple IListener<T>
Describe the bug When a class implements multiple IListener<T> the Broadcast fails because the HandleAsync is Ambiguous.
Affected Coravel Feature Events
Expected behavior Possible to use multiple IListerner at the same class
As workaround i changed following line in the Dispatcher.cs
From:
var result = listenerType.GetMethod("HandleAsync").Invoke(obj, new object[] { toBroadcast });
To:
var result = listenerType.GetMethod("HandleAsync", new Type[] {toBroadcast.GetType()}).Invoke(obj, new object[] { toBroadcast });
Thanks for this. Yes, this will require some changes to how the internals of the dispatcher work. But this scenario does make sense and I can see why it ought to be supported.
Will update once work has been done 🙂
Thanks for this. Yes, this will require some changes to how the internals of the dispatcher work. But this scenario does make sense and I can see why it ought to be supported.
Will update once work has been done 🙂
Would it be possible to expose the ability to supply one's own dispatcher (and possible IEventRegistration
...) officially? I have the same issue, with the added desire for dynamic registration [and removal]. Possible atm via proxy, but it's a lot of ceremony. :(