const pool = new DynamicClusterPool(
min,
max,
- './tests/worker/cluster/testWorker.js',
+ './tests/worker-files/cluster/testWorker.js',
{
errorHandler: e => console.error(e),
onlineHandler: () => console.log('worker is online')
const pool1 = new DynamicClusterPool(
1,
1,
- './tests/worker/cluster/testWorker.js'
+ './tests/worker-files/cluster/testWorker.js'
)
const res = await pool1.execute({ test: 'test' })
expect(res).toBeFalsy()
const maxTasks = 500
const pool = new FixedClusterPool(
numberOfWorkers,
- './tests/worker/cluster/testWorker.js',
+ './tests/worker-files/cluster/testWorker.js',
{
errorHandler: e => console.error(e),
onlineHandler: () => console.log('worker is online')
)
const emptyPool = new FixedClusterPool(
1,
- './tests/worker/cluster/emptyWorker.js'
+ './tests/worker-files/cluster/emptyWorker.js'
+)
+const echoPool = new FixedClusterPool(
+ 1,
+ './tests/worker-files/cluster/echoWorker.js'
)
-const echoPool = new FixedClusterPool(1, './tests/worker/cluster/echoWorker.js')
const errorPool = new FixedClusterPool(
1,
- './tests/worker/cluster/errorWorker.js',
+ './tests/worker-files/cluster/errorWorker.js',
{
errorHandler: e => console.error(e),
onlineHandler: () => console.log('worker is online')
const asyncErrorPool = new FixedClusterPool(
1,
- './tests/worker/cluster/asyncErrorWorker.js',
+ './tests/worker-files/cluster/asyncErrorWorker.js',
{
onlineHandler: () => console.log('worker is online')
}
)
const asyncPool = new FixedClusterPool(
1,
- './tests/worker/cluster/asyncWorker.js',
+ './tests/worker-files/cluster/asyncWorker.js',
{
maxTasks: maxTasks
}
it('Should work even without opts in input', async () => {
const pool1 = new FixedClusterPool(
1,
- './tests/worker/cluster/testWorker.js'
+ './tests/worker-files/cluster/testWorker.js'
)
const res = await pool1.execute({ test: 'test' })
expect(res).toBeFalsy()
const pool = new DynamicThreadPool(
min,
max,
- './tests/worker/thread/testWorker.js',
+ './tests/worker-files/thread/testWorker.js',
{
errorHandler: e => console.error(e),
onlineHandler: () => console.log('worker is online')
const pool1 = new DynamicThreadPool(
1,
1,
- './tests/worker/thread/testWorker.js'
+ './tests/worker-files/thread/testWorker.js'
)
const res = await pool1.execute({ test: 'test' })
expect(res).toBeFalsy()
const maxTasks = 400
const pool = new FixedThreadPool(
numberOfThreads,
- './tests/worker/thread/testWorker.js',
+ './tests/worker-files/thread/testWorker.js',
{
errorHandler: e => console.error(e),
onlineHandler: () => console.log('worker is online')
}
)
-const emptyPool = new FixedThreadPool(1, './tests/worker/thread/emptyWorker.js')
-const echoPool = new FixedThreadPool(1, './tests/worker/thread/echoWorker.js')
+const emptyPool = new FixedThreadPool(
+ 1,
+ './tests/worker-files/thread/emptyWorker.js'
+)
+const echoPool = new FixedThreadPool(
+ 1,
+ './tests/worker-files/thread/echoWorker.js'
+)
const errorPool = new FixedThreadPool(
1,
- './tests/worker/thread/errorWorker.js',
+ './tests/worker-files/thread/errorWorker.js',
{
errorHandler: e => console.error(e),
onlineHandler: () => console.log('worker is online')
)
const asyncPool = new FixedThreadPool(
1,
- './tests/worker/thread/asyncWorker.js',
+ './tests/worker-files/thread/asyncWorker.js',
{ maxTasks: maxTasks }
)
})
it('Should work even without opts in input', async () => {
- const pool1 = new FixedThreadPool(1, './tests/worker/thread/testWorker.js')
+ const pool1 = new FixedThreadPool(
+ 1,
+ './tests/worker-files/thread/testWorker.js'
+ )
const res = await pool1.execute({ test: 'test' })
expect(res).toBeFalsy()
})