}
}
- private checkAndEmitDynamicWorkerCreationEvents (): void {
- if (this.type === PoolTypes.dynamic) {
- if (this.full) {
- this.emitter?.emit(PoolEvents.full, this.info)
- }
- }
- }
+ /**
+ * Emits dynamic worker creation events.
+ */
+ protected abstract checkAndEmitDynamicWorkerCreationEvents (): void
/**
* Gets the worker information given its worker node key.
import { checkDynamicPoolSize } from '../utils'
-import { type PoolType, PoolTypes } from '../pool'
+import { PoolEvents, type PoolType, PoolTypes } from '../pool'
import { type ClusterPoolOptions, FixedClusterPool } from './fixed'
/**
return !this.full && this.internalBusy()
}
+ /** @inheritDoc */
+ protected checkAndEmitDynamicWorkerCreationEvents (): void {
+ if (this.full) {
+ this.emitter?.emit(PoolEvents.full, this.info)
+ }
+ }
+
/** @inheritDoc */
protected get type (): PoolType {
return PoolTypes.dynamic
return false
}
+ /** @inheritDoc */
+ protected checkAndEmitDynamicWorkerCreationEvents (): void {}
+
/** @inheritDoc */
protected get type (): PoolType {
return PoolTypes.fixed
-import { type PoolType, PoolTypes } from '../pool'
+import { PoolEvents, type PoolType, PoolTypes } from '../pool'
import { checkDynamicPoolSize } from '../utils'
import { FixedThreadPool, type ThreadPoolOptions } from './fixed'
return !this.full && this.internalBusy()
}
+ /** @inheritDoc */
+ protected checkAndEmitDynamicWorkerCreationEvents (): void {
+ if (this.full) {
+ this.emitter?.emit(PoolEvents.full, this.info)
+ }
+ }
+
/** @inheritDoc */
protected get type (): PoolType {
return PoolTypes.dynamic
return false
}
+ /** @inheritDoc */
+ protected checkAndEmitDynamicWorkerCreationEvents (): void {}
+
/** @inheritDoc */
protected get type (): PoolType {
return PoolTypes.fixed