Closed ahoyahoy closed 9 months ago
You'll have to create a dedicated worker that has the functions it
, evalInScope
, etc. And you will somehow have to make the dedicated functions available inside this dedicated worker, for example by passing the path of the file where they are located and load that file inside the worker, or by sending over the code of the functions and evaluating this with eval
inside the worker (though using eval
is not a good idea in general).
@josdejong trying it your way
Hi there :)
I'm trying to make a testing worker, but I can't give it context functions.
simple testing environment
it works this way correctly
it(context, 'test1', 'return addFn(3,2)')
but how to use aditional functions in worker?
returns an error
context functions are dynamic
Please advice how to do it :)