X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Findex.ts;h=4730ad6557a5a922beb5db4aabb9eb0379832e06;hb=520c8c68ceeccd6b9f4cd363241fdd2c4d628234;hp=db6960b86af815b03e43460a3cfef9dfc591a3f8;hpb=db274bfd5662a85eb7bbcac6e59701cf00444775;p=poolifier.git diff --git a/src/index.ts b/src/index.ts index db6960b8..4730ad65 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,72 @@ -import DynamicThreadPool from './dynamic' -import FixedThreadPool from './fixed' -import { ThreadWorker } from './workers' - +export type { AbstractPool } from './pools/abstract-pool' +export { DynamicClusterPool } from './pools/cluster/dynamic' export { + FixedClusterPool, + type ClusterPoolOptions +} from './pools/cluster/fixed' +export { PoolEvents, PoolTypes, WorkerTypes } from './pools/pool' +export type { + IPool, + PoolEmitter, + PoolEvent, + PoolInfo, + PoolOptions, + PoolType, + TasksQueueOptions, + WorkerType +} from './pools/pool' +export type { + ErrorHandler, + EventLoopUtilizationMeasurementStatistics, + ExitHandler, + IWorker, + MeasurementStatistics, + MessageHandler, + OnlineHandler, + Task, + TaskStatistics, + WorkerNode, + WorkerUsage +} from './pools/worker' +export { + Measurements, + WorkerChoiceStrategies +} from './pools/selection-strategies/selection-strategies-types' +export type { + IWorkerChoiceStrategy, + Measurement, + MeasurementOptions, + MeasurementStatisticsRequirements, + StrategyPolicy, + TaskStatisticsRequirements, + WorkerChoiceStrategy, + WorkerChoiceStrategyOptions +} from './pools/selection-strategies/selection-strategies-types' +export type { WorkerChoiceStrategyContext } from './pools/selection-strategies/worker-choice-strategy-context' +export { DynamicThreadPool } from './pools/thread/dynamic' +export { + FixedThreadPool, + type ThreadPoolOptions, + type ThreadWorkerWithMessageChannel +} from './pools/thread/fixed' +export type { AbstractWorker } from './worker/abstract-worker' +export { ClusterWorker } from './worker/cluster-worker' +export { ThreadWorker } from './worker/thread-worker' +export { KillBehaviors } from './worker/worker-options' +export type { KillBehavior, WorkerOptions } from './worker/worker-options' +export type { + TaskFunctions, + WorkerAsyncFunction, + WorkerFunction, + WorkerSyncFunction +} from './worker/worker-functions' +export type { Draft, - FixedThreadPoolOptions, - WorkerWithMessageChannel -} from './fixed' -export { DynamicThreadPoolOptions } from './dynamic' -export { ThreadWorkerOptions } from './workers' -export { FixedThreadPool, DynamicThreadPool, ThreadWorker } - -module.exports = { FixedThreadPool, DynamicThreadPool, ThreadWorker } + MessageValue, + PromiseResponseWrapper, + TaskError, + TaskPerformance, + WorkerStatistics +} from './utility-types' +export type { CircularArray } from './circular-array' +export type { Queue } from './queue'