X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futility-types.ts;h=08861ebd30045ae430de21eae055f9634a007341;hb=dab8c377b70fc962ec217f2aeb719842f9f94cd6;hp=54e66e1bbe9432c1c23c2851ca0466486d5efed5;hpb=70c7d7d3af9c38417416ca9096a6ab3ae835b5d0;p=poolifier.git diff --git a/src/utility-types.ts b/src/utility-types.ts index 54e66e1b..08861ebd 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -19,7 +19,7 @@ export type Draft = { -readonly [P in keyof T]?: T[P] } */ export interface MessageValue< Data = unknown, - MainWorker extends ClusterWorker | MessagePort | unknown = unknown + MainWorker extends ClusterWorker | MessagePort = ClusterWorker | MessagePort > extends Task { /** * Kill code. @@ -48,6 +48,7 @@ export interface MessageValue< export type WorkerSyncFunction = ( data?: Data ) => Response + /** * Worker asynchronous function that can be executed. * This function must return a promise. @@ -58,6 +59,7 @@ export type WorkerSyncFunction = ( export type WorkerAsyncFunction = ( data?: Data ) => Promise + /** * Worker function that can be executed. * This function can be synchronous or asynchronous. @@ -68,8 +70,9 @@ export type WorkerAsyncFunction = ( export type WorkerFunction = | WorkerSyncFunction | WorkerAsyncFunction + /** - * Worker functions that can be executed object. + * Worker functions that can be executed. * This object can contain synchronous or asynchronous functions. * The key is the name of the function. * The value is the function itself.