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

setTimeout #17

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

setTimeout #17

seriousManual opened this issue May 22, 2012 · 5 comments

Comments

@seriousManual
Copy link

Inside a thread there is no possibility to use setTimeout.

@jiban
Copy link

jiban commented Jul 25, 2012

I would vote for it. :-)

@hf
Copy link

hf commented Sep 19, 2012

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

@Darkhogg
Copy link

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.

@seriousManual
Copy link
Author

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
@jnfeinstein
Copy link

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
Projects
None yet
Development

No branches or pull requests

6 participants