bsorrentino / cordova-broadcaster

Cordova Plugin to allow message exchange between javascript and native (and viceversa)
MIT License
113 stars 53 forks source link

Why `sendBroadcastSync` over `sendBroadcast`? #44

Closed Dragas closed 3 years ago

Dragas commented 5 years ago

In the example you suggest using sendBroadcastSync, but documentation suggests that it's a blocking operation. How come you suggest using it over the regular version of that call?

bsorrentino commented 5 years ago

Hi @Dragas

sendBroadcastSync vs sendBroadcast is like synchronous vs asynchronous and for sure this will involve the thread on which the message will be processed.

However the plugin forces execution within UIThread so you can use which you prefer depending on yours use case

hope this help

bsorrentino commented 3 years ago

closed for inactivity