Are amplify.js's pub/sub events implemented as Synchronous or Asynchronous?
http://amplifyjs.com/api/pubsub/
The documentation does mention priorities...
Publishing is synchronous; prioritization and synchronicity aren't really related.
It's synchronous.
The subscription callbacks are called from within the .publish()
method's implementation. There is no setTimeout()
code.
As far as priorities go, priority
determines where to inject the callback in the callback stack. This logic is handled in .subscribe()
. The .publish()
method just executes the callbacks in stack order as previously determined by the .subscribe()
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With