this.stopCheckActive()
if (isAsyncFunction(this.opts.killHandler)) {
(this.opts.killHandler?.() as Promise<void>)
.then(() => {
this.sendToMainWorker({ kill: 'success' })
this.stopCheckActive()
if (isAsyncFunction(this.opts.killHandler)) {
(this.opts.killHandler?.() as Promise<void>)
.then(() => {
this.sendToMainWorker({ kill: 'success' })
private checkMessageWorkerId (message: MessageValue<Data>): void {
if (message.workerId == null) {
throw new Error('Message worker id is not set')
private checkMessageWorkerId (message: MessageValue<Data>): void {
if (message.workerId == null) {
throw new Error('Message worker id is not set')
*/
protected run (task: Task<Data>): void {
const { name, taskId, data } = task
*/
protected run (task: Task<Data>): void {
const { name, taskId, data } = task
if (isAsyncFunction(fn)) {
this.runInAsyncScope(this.runAsync.bind(this), this, fn, task)
} else {
if (isAsyncFunction(fn)) {
this.runInAsyncScope(this.runAsync.bind(this), this, fn, task)
} else {