summaryrefslogtreecommitdiff
path: root/node_modules/webworker-threads/test/test14_emit_once.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/webworker-threads/test/test14_emit_once.js')
-rw-r--r--node_modules/webworker-threads/test/test14_emit_once.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/webworker-threads/test/test14_emit_once.js b/node_modules/webworker-threads/test/test14_emit_once.js
new file mode 100644
index 0000000..6b38812
--- /dev/null
+++ b/node_modules/webworker-threads/test/test14_emit_once.js
@@ -0,0 +1,20 @@
+
+
+var t= require('webworker-threads');
+
+function killHandler (data) {
+ console.log("GOT KILL with data -> "+ data);
+ o.destroy();
+}
+
+function boot () {
+ thread.once('kill', function (data) {
+ thread.emit('kill', data);
+ });
+}
+
+o= t.create().once('kill', killHandler).eval(boot).eval('boot()').emit('kill', "*** DATA");
+
+process.on('exit', function () {
+ console.log("Bye!");
+});