NimaAra / Easy.MessageHub

No need for .NET Events! A thread-safe, high performance & easy to use cross platform implementation of the Event Aggregator Pattern.
MIT License
258 stars 41 forks source link

Publish and subscribe from different threads #9

Closed lrhage closed 7 years ago

lrhage commented 7 years ago

Hi! I need to subscribe from the UI thread and update controls. Is there a way to "subscribe on current thread"? I know that I can use SynchronizationContext (I'm using WinForms) but that's mean to change a lot of code.

Thanks!

NimaAra commented 7 years ago

Hi,

While the library is tread-safe in the sense that you can publish and subscribe from different threads, it does not handle UI-synchronization for the user. This was done intentionally so that the user can choose the best marshalling strategy.

As you mentioned, SynchronizationContext is the way to go.

desarrollo03TR commented 7 years ago

Thanks!