Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

setTimeout #17

Open
seriousManual opened this Issue May 22, 2012 · 5 comments

Comments

Projects
None yet
6 participants

Inside a thread there is no possibility to use setTimeout.

jiban commented Jul 25, 2012

I would vote for it. :-)

hf commented Sep 19, 2012

Doesn't that defeat the purpose of threads? Why don't you just sleep...

Depending on what you want, I might agree or disagree with this completely:

  • Executing a callback on the main thread after a while, registering it on a different thread: OK
  • Executing a callback on the same thread that called setTimeout after a while: BAD

I don't see any situation in which the first one may be used, but it's a reasonable thing to do.
I really don't see the point of the second, as the nature of the threading model would make the thread either completely busy orcompletely free by the time the timeout fires. Either the task would be running, making it impossible to fire the callback, or the task would have been ended, thus making it more reasonable to fire it on the main thread.

If @zaphod1984 makes it clear exactly what (s)he wants and why, maybe the developers/contributors may discuss it.

actually i tried setTimeout simply to test a delayed response from a worker thread. i do not have an actual usecase.

@xk xk reopened this Apr 11, 2013

These are defined in a native module, and I don't think there is a clean solution to implement them on tagg threads. See my long comment in #22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment