for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) {
const pool = new FixedThreadPool(
max,
for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) {
const pool = new FixedThreadPool(
max,
)
pool.setWorkerChoiceStrategy(workerChoiceStrategy)
expect(pool.opts.workerChoiceStrategy).toBe(workerChoiceStrategy)
)
pool.setWorkerChoiceStrategy(workerChoiceStrategy)
expect(pool.opts.workerChoiceStrategy).toBe(workerChoiceStrategy)
it('Verify available strategies default internals at pool creation', async () => {
const pool = new FixedThreadPool(
max,
it('Verify available strategies default internals at pool creation', async () => {
const pool = new FixedThreadPool(
max,
it('Verify LEAST_USED strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
it('Verify LEAST_USED strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED }
)
// TODO: Create a better test to cover `LeastUsedWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED }
)
// TODO: Create a better test to cover `LeastUsedWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED }
)
// TODO: Create a better test to cover `LeastUsedWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED }
)
// TODO: Create a better test to cover `LeastUsedWorkerChoiceStrategy#choose`
it('Verify LEAST_BUSY strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
it('Verify LEAST_BUSY strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY }
)
// TODO: Create a better test to cover `LeastBusyWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY }
)
// TODO: Create a better test to cover `LeastBusyWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY }
)
// TODO: Create a better test to cover `LeastBusyWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY }
)
// TODO: Create a better test to cover `LeastBusyWorkerChoiceStrategy#choose`
it('Verify LEAST_ELU strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
it('Verify LEAST_ELU strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_ELU }
)
// TODO: Create a better test to cover `LeastEluWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_ELU }
)
// TODO: Create a better test to cover `LeastEluWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_ELU }
)
// TODO: Create a better test to cover `LeastEluWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.LEAST_ELU }
)
// TODO: Create a better test to cover `LeastEluWorkerChoiceStrategy#choose`
it('Verify FAIR_SHARE strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
it('Verify FAIR_SHARE strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
{ workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE }
)
// TODO: Create a better test to cover `FairShareChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE }
)
// TODO: Create a better test to cover `FairShareChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE }
)
// TODO: Create a better test to cover `FairShareChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE }
)
// TODO: Create a better test to cover `FairShareChoiceStrategy#choose`
{
workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE,
workerChoiceStrategyOptions: {
{
workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE,
workerChoiceStrategyOptions: {
const workerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let pool = new FixedThreadPool(
max,
const workerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let pool = new FixedThreadPool(
max,
const workerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let pool = new FixedThreadPool(
max,
const workerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let pool = new FixedThreadPool(
max,
it('Verify WEIGHTED_ROUND_ROBIN strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
it('Verify WEIGHTED_ROUND_ROBIN strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
{ workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
)
// TODO: Create a better test to cover `WeightedRoundRobinWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
)
// TODO: Create a better test to cover `WeightedRoundRobinWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
)
// TODO: Create a better test to cover `WeightedRoundRobinWorkerChoiceStrategy#choose`
{ workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
)
// TODO: Create a better test to cover `WeightedRoundRobinWorkerChoiceStrategy#choose`
{
workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN,
workerChoiceStrategyOptions: {
{
workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN,
workerChoiceStrategyOptions: {
const workerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let pool = new FixedThreadPool(
max,
const workerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let pool = new FixedThreadPool(
max,
it('Verify INTERLEAVED_WEIGHTED_ROUND_ROBIN strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,
it('Verify INTERLEAVED_WEIGHTED_ROUND_ROBIN strategy can be run in a fixed pool', async () => {
const pool = new FixedThreadPool(
max,