Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
await pool.execute(data, name, transferList)
)
}
+ if (!fastify.hasDecorator('mapExecute')) {
+ fastify.decorate(
+ 'mapExecute',
+ async (
+ data: Iterable<ThreadWorkerData>,
+ name?: string,
+ transferList?: readonly TransferListItem[]
+ ): Promise<ThreadWorkerResponse[]> =>
+ await pool.mapExecute(data, name, transferList)
+ )
+ }
done()
}
): Promise<WorkerResponse> => await pool.execute(data, name, transferList)
)
}
+ if (!fastify.hasDecorator('mapExecute')) {
+ fastify.decorate(
+ 'mapExecute',
+ async (
+ data: Iterable<WorkerData>,
+ name?: string,
+ transferList?: readonly TransferListItem[]
+ ): Promise<WorkerResponse[]> =>
+ await pool.mapExecute(data, name, transferList)
+ )
+ }
done()
}