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

Event Aggregator marshaller set by subscription #416

Closed
jozefizso opened this issue Feb 21, 2017 · 4 comments
Closed

Event Aggregator marshaller set by subscription #416

jozefizso opened this issue Feb 21, 2017 · 4 comments
Milestone

Comments

@jozefizso
Copy link
Contributor

Is it viable to have IEventAggregator where the subscriber will specify the type of thread marshaller it supports (UI thread vs background job) and the event aggregator Publish() method will be thread agnostic?

For example, MvvmCross IMvxMessenger interface has these methods:

Subscribe()
SubscribeOnMainThread()
SubscribeOnThreadPoolThread()
Publish()

Can this pattern be used with Caliburn? Or are there some specifics why Caliburn requires the Publisher to set the thread?

@nigel-sampson
Copy link
Contributor

At the moment this wouldn't be possible with extensions to the EventAggregator, there aren't any specific reasons why it was done this way (publisher specifying the threading rather than the subscriber).

@nigel-sampson
Copy link
Contributor

Thinking about this some more, it should be easy to follow the Publish pattern and have an overload of Subscribe that takes a marshaling method.

Extensions for the examples above could then all be provided.

@nigel-sampson nigel-sampson added this to the v3.1.0 milestone Feb 23, 2017
@nigel-sampson
Copy link
Contributor

Realised this will need to be a breaking change on the IEventAggregator interface and should be in 4.0.0.

@nigel-sampson
Copy link
Contributor

This is done now as part of 4.0.0 and #496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants