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

Automatically invoke Tcl event loop only while necessary #3

Open
bovine opened this issue Nov 9, 2011 · 2 comments
Open

Automatically invoke Tcl event loop only while necessary #3

bovine opened this issue Nov 9, 2011 · 2 comments

Comments

@bovine
Copy link
Owner

bovine commented Nov 9, 2011

Currently, to keep the Tcl event loop processing, it is necessary for the Javascript side to ensure that interp.process_events() or interp.eval("update") is periodically processed. However, this is currently an implementation detail that the user should not have to be aware of.

The normal Node.JS behavior is to exit the "node" process once it has reached the end of the script file and there are no remaining event handlers installed or eligible to potentially run in the future.

It would be desirable to make interp.eval() silently install a hook that would periodically call interp.process_events() only as long as there are Tcl event handlers that could be triggered. This would allow the same normal Node.JS behavior of automatically exiting the process once all JavaScript and Tcl event handlers have completed, without any additional special handling code by the user.

The limiting factor currently seems to be that there is no way from the Tcl C API to determine if there are no more installed Tcl event handlers. There are some details in "man n Notifier" about the Tcl event sources, which might be relevant but this requires more research.

@ekarak
Copy link

ekarak commented Dec 7, 2015

Hey if you're still interested here's an initial attempt at solving this problem:
ekarak/node-tcl@2ab3923
It involves replacing the default tcl event loop with a custom v8/uv-driven one.
Cheers,
Elias

@bovine
Copy link
Owner Author

bovine commented Dec 7, 2015

It looks like nukedzn/node-tcl is a completely independent project, not
derived from mine at all? I wasn't aware of any other similar efforts yet.

On Mon, Dec 7, 2015 at 1:42 AM, Elias Karakoulakis <[email protected]

wrote:

Hey if you're still interested here's an initial attempt at solving this
problem:
ekarak/node-tcl@2ab3923
ekarak/node-tcl@2ab3923
It involves replacing the default tcl event loop with a custom
v8/uv-driven one.
Cheers,
Elias


Reply to this email directly or view it on GitHub
#3 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants