X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=b8d02a3b8d2306644cd511e74b60732eaf82652f;hb=15d6dfaf877ec6a99e2bde48cb3c8a9e8671c075;hp=5338a29f2ff748c7d74194914b5949ec33b3a7eb;hpb=dde90273424a8c6dbfaddcc7e6a771623c521f2c;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 5338a29f..b8d02a3b 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -19,10 +19,11 @@

A thread pool with a fixed number of threads.

It is possible to perform tasks in sync or asynchronous mode as you prefer.

This pool selects the threads in a round robin fashion.

+
+
+

Author

Alessandro Pio Ardizio

-

Author

Alessandro Pio Ardizio

- -

Since

0.0.1

+

Since

0.0.1

Type Parameters

@@ -30,11 +31,13 @@
  • Data = unknown

    Type of data sent to the worker. This can only be serializable data.

    -
  • + +
  • Response = unknown

    Type of execution response. This can only be serializable data.

    -
  • + +

    Hierarchy

    +
  • Defined in src/pools/thread/fixed.ts:34
  • @@ -52,54 +55,56 @@

    Constructors

    - + -

    Returns FixedThreadPool<Data, Response>

    +
  • Defined in src/pools/thread/fixed.ts:45
  • Properties

    - +
    emitter?: PoolEmitter

    Emitter on which events can be listened to.

    Events that can currently be listened to:

    • 'full': Emitted when the pool is dynamic and full.
    • 'busy': Emitted when the pool is busy.
    • +
    • 'error': Emitted when an uncaught error occurs.
    • +
    • 'taskError': Emitted when an error occurs while executing a task.
    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:47
  • +
    +
    filePath: string

    Path to the worker file.

    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:82
  • +
    +
    numberOfWorkers: number

    Number of workers that this pool should manage.

    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:81
  • +
    +

    Options for the pool.

    -
    +
  • Defined in src/pools/abstract-pool.ts:83
  • - +
    promiseResponseMap: Map<string, PromiseResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...

    The execution response promise map.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    +
  • Defined in src/pools/abstract-pool.ts:57
  • - +
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<ThreadWorkerWithMessageChannel, Data, Response>

    Worker choice strategy context referencing a worker choice algorithm implementation.

    Default to a round robin algorithm.

    -
    +
  • Defined in src/pools/abstract-pool.ts:67
  • - +
    workerNodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []

    Pool worker nodes.

    -
    +
  • Defined in src/pools/abstract-pool.ts:44
  • Accessors

    - +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    +
  • Defined in src/pools/thread/fixed.ts:100
  • +
    + +

    Methods

    - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:464
  • - + -

    Returns void

    +
  • Defined in src/pools/thread/fixed.ts:90
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:453
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:532
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:596
  • - +
    +
  • Defined in src/pools/thread/fixed.ts:83
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:415
  • - + -

    Returns Promise<void>

    +
  • Defined in src/pools/thread/fixed.ts:59
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:325
  • - + + +
    +
  • +
    Optional name: string
    +

    The name of the worker function to execute. If not specified, the default worker function will be executed.

    +
    +
  • Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    -
    +
  • Defined in src/pools/abstract-pool.ts:380
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:371
  • - +
    +
  • Defined in src/pools/thread/fixed.ts:54
  • - + -

    Returns void

    +
  • Defined in src/pools/thread/fixed.ts:75
  • - + -

    Returns void

    +
  • Defined in src/pools/thread/fixed.ts:67
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:337
  • - + +

    Returns void

    +
    +
  • Defined in src/pools/abstract-pool.ts:284
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:314
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:438
  • - +

    Returns void

    The listener function to execute when a message is received from a worker.

    -
    +
  • Defined in src/pools/abstract-pool.ts:629
  • +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • info
  • +
  • maxSize
  • +
  • minSize
  • +
  • type
  • +
  • worker
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerSetup
  • +
  • beforeTaskExecutionHook
  • +
  • chooseWorkerNode
  • +
  • createAndSetupWorker
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorker
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • internalBusy
  • +
  • isMain
  • +
  • registerWorkerMessageListener
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • Queue
  • +
  • ThreadWorker
  • +
  • WorkerChoiceStrategyContext
  • +
  • ClusterPoolOptions
  • +
  • IPool
  • +
  • IWorker
  • +
  • IWorkerChoiceStrategy
  • +
  • MessageValue
  • +
  • PoolInfo
  • +
  • PoolOptions
  • +
  • PromiseResponseWrapper
  • +
  • RequiredStatistics
  • +
  • Task
  • +
  • TasksQueueOptions
  • +
  • TasksUsage
  • +
  • WorkerChoiceStrategyOptions
  • +
  • WorkerNode
  • +
  • WorkerOptions
  • +
  • Draft
  • +
  • ErrorHandler
  • +
  • ExitHandler
  • +
  • KillBehavior
  • +
  • MessageHandler
  • +
  • OnlineHandler
  • +
  • PoolEvent
  • +
  • PoolType
  • +
  • TaskFunctions
  • +
  • ThreadWorkerWithMessageChannel
  • +
  • WorkerAsyncFunction
  • +
  • WorkerChoiceStrategy
  • +
  • WorkerFunction
  • +
  • WorkerSyncFunction
  • +
  • WorkerType
  • +
  • KillBehaviors
  • +
  • PoolEvents
  • +
  • PoolTypes
  • +
  • WorkerChoiceStrategies
  • +
  • WorkerTypes
  • Generated using TypeDoc

    \ No newline at end of file