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

Better management of async #7

Open
federico-lox opened this issue Jul 8, 2012 · 1 comment
Open

Better management of async #7

federico-lox opened this issue Jul 8, 2012 · 1 comment
Assignees
Milestone

Comments

@federico-lox
Copy link
Owner

window.postMessage is proved to be invoked earlier than setTimeout:

https://developer.mozilla.org/en/DOM/window.postMessage
http://dbaron.org/log/20100309-faster-timeouts

The problem is that is not supported everywhere:

http://caniuse.com/#feat=x-doc-messaging

Idea (to be tested):

use postMessage, if not available fallback to setTimeout (NodeJS/Browser) or Titanium.Application.fireEvent (Titanium)

@ghost ghost assigned federico-lox Jul 8, 2012
@federico-lox
Copy link
Owner Author

It's 2014 and window.postMessage is supported everywhere! YAY! 👍

For Node the code should use the process.nextTick (see here)

No need to include a case for setImmediate as it uses the same internals of window.postMessage and Gecko + Webkit aren't going to implement it any time soon

@federico-lox federico-lox added this to the 1.0 milestone May 26, 2014
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

1 participant