aboutsummaryrefslogtreecommitdiff
path: root/jim_tcl.txt
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-09-10 15:15:04 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:51 +1000
commit38733caf6dc5e8556283c62468d0b3f20d5911dd (patch)
tree6b527d13a02bcfdfaf0c98daa321f6da0167d7f3 /jim_tcl.txt
parentfe33a846cd13edf9440b81756896105ab4a86680 (diff)
downloadjimtcl-38733caf6dc5e8556283c62468d0b3f20d5911dd.zip
jimtcl-38733caf6dc5e8556283c62468d0b3f20d5911dd.tar.gz
jimtcl-38733caf6dc5e8556283c62468d0b3f20d5911dd.tar.bz2
Fix some eventloop problems
File handlers now pass through the error code and the handler is deleted on error. If there is nothing to do, vwait returns. If bgerror doesn't exist, print the original error to stderr. Also remove the 'eof' event handler since it isn't needed. Can just call [eof $f]. This also fixes source locations within 'readable' scripts. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim_tcl.txt')
-rw-r--r--jim_tcl.txt11
1 files changed, 7 insertions, 4 deletions
diff --git a/jim_tcl.txt b/jim_tcl.txt
index 4299d37..62e8990 100644
--- a/jim_tcl.txt
+++ b/jim_tcl.txt
@@ -76,6 +76,7 @@ Since v0.62:
13. It is now possible to 'return' from within 'try'
14. IPv6 support is now included
15. Add 'string is'
+16. Event handlers works better if an error occurs. eof handler has been removed.
Since v0.61:
@@ -3989,15 +3990,17 @@ eventloop: after, vwait
~~~~~~~~~~~~~~~~~~~~~~~
The following commands allow a script to be invoked when the given condition occurs.
+If no script is given, returns the current script. If the given script is the empty, the
+handler is removed.
-+$handle *readable* '?readable-script ?eof-script??'+::
- Returns script, or invoke readable-script when readable, eof-script on eof, {} to remove
++$handle *readable* '?readable-script?'+::
+ Sets or returns the script for when the socket is readable.
+$handle *writable* '?writable-script?'+::
- Returns script, or invoke writable-script when writable, {} to remove
+ Sets or returns the script for when the socket is writable.
+$handle *onexception* '?exception-script?'+::
- Returns script, or invoke exception-script when oob data, {} to remove
+ Sets or returns the script for when when oob data received.
Time-based execution is also available via the eventloop API.