Error handling and unit tests
[poolifier.git] / tests / workers / echoWorker.js
diff --git a/tests/workers/echoWorker.js b/tests/workers/echoWorker.js
new file mode 100644 (file)
index 0000000..2a5ef89
--- /dev/null
@@ -0,0 +1,14 @@
+'use strict'
+const { ThreadWorker } = require('../../lib/workers')
+
+function echo (data) {
+  return data
+}
+
+class MyWorker extends ThreadWorker {
+  constructor () {
+    super(echo, { maxInactiveTime: 500 })
+  }
+}
+
+module.exports = new MyWorker()