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

CocoaAction thread safety #122

Open
mosamer opened this issue Nov 2, 2017 · 4 comments
Open

CocoaAction thread safety #122

mosamer opened this issue Nov 2, 2017 · 4 comments

Comments

@mosamer
Copy link
Contributor

mosamer commented Nov 2, 2017

While there is no guarantees for thread-safety on Action. CocoaAction exposed public API should guarantee delivering events on main thread to ensure safe binding to UI.

@mosamer
Copy link
Contributor Author

mosamer commented Nov 2, 2017

IMO, #40 might be taken into consideration while discussing this.

@mosamer mosamer added this to the Release-4.0 milestone Nov 2, 2017
@bobgodwinx
Copy link
Member

Good point here I would go with something like this MainScheduler.ensureExecutingOnScheduler() and then throw a fatalError if not.

@mosamer
Copy link
Contributor Author

mosamer commented Nov 7, 2017

I am not sure how MainSchdulre.ensureExecutingOnScheduler() can be used here

@bobgodwinx
Copy link
Member

MainScheduler.ensureExecutingOnScheduler() is widely used mainly to make sure that subsequent lines of code that follows will be executed on the main queue for example Drivers are executed on the main queue like this MainScheduler.ensureExecutingOnScheduler(errorMessage: errorMessage). So Action should not be that different. An alternative would be to start asking the user to provide us a Scheduler where to run the code. But this will be an overkill IMHO

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