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

"main queue setup" in Swift vs Objective-C modules? #397

Open
brodycj opened this issue Jul 9, 2021 · 2 comments
Open

"main queue setup" in Swift vs Objective-C modules? #397

brodycj opened this issue Jul 9, 2021 · 2 comments

Comments

@brodycj
Copy link

brodycj commented Jul 9, 2021

Hi I am working on adding Swift support to create-react-native-module (see brodycj/create-react-native-module#353) and have encountered a message like this:

Module ATest requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.

Of course the solution would be to add a requiresMainQueueSetup method to the Swift module, but it leaves me wondering why this should be specified for Swift but not Objective-C, not to mention Android?

Should we assume that the background threading would not cause issues with most native modules on iOS and Android?

Or should we consider calling native modules from the main thread by default, unless otherwise specified?

And I think this needs to be documented. Here is what I found so far, only for Android:

@radko93
Copy link

radko93 commented Jul 12, 2021

Everything is described quite well here https://stackoverflow.com/questions/50773748/difference-requiresmainqueuesetup-and-dispatch-get-main-queue/50775641

@yaghobi4398010

This comment has been minimized.

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

No branches or pull requests

3 participants