@dudousxd/nestjs-durable 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { StepError, WorkflowRef, SingletonConfig, WorkflowExecutor, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowEngine, EntityHandler, StepInvocation, WorkflowClass, WorkflowInputOf, StartOptions, RunResult } from '@dudousxd/nestjs-durable-core';
2
- import { RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
2
+ import { ConcurrencyOption, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
3
3
  import { DynamicModule, InjectionToken, OnModuleInit, OnApplicationBootstrap, OnApplicationShutdown, Provider } from '@nestjs/common';
4
4
  import { DiscoveryService, MetadataScanner } from '@nestjs/core';
5
5
 
@@ -138,7 +138,12 @@ interface DurableStepMeta {
138
138
  * (e.g. the event-emitter transport) routes dispatched tasks to it. The method's single
139
139
  * argument is the step input; its return value is the step output.
140
140
  */
141
- declare function DurableStep(name: string): MethodDecorator;
141
+ declare function Step(name: string): MethodDecorator;
142
+ /**
143
+ * @deprecated Use `@Step` instead. `@DurableStep` is a back-compat alias of {@link Step} and
144
+ * writes the same `DURABLE_STEP_METADATA`, so discovery/registrars treat them identically.
145
+ */
146
+ declare const DurableStep: typeof Step;
142
147
  declare function getDurableStepMeta(method: Function): DurableStepMeta | undefined;
143
148
  declare const DEAD_LETTER_METADATA: unique symbol;
144
149
  /**
@@ -181,7 +186,7 @@ declare function getOnEvents(meta: WorkflowMeta, target: object): string[];
181
186
  /**
182
187
  * Options for a **store-less thin worker** process: where to consume (`connection`/`prefix`) and
183
188
  * which worker `groups` this process serves. There is deliberately NO `store`, `transport`, engine,
184
- * dashboard, recovery, or timer config — a thin worker only registers `@Workflow`/`@DurableStep`
189
+ * dashboard, recovery, or timer config — a thin worker only registers `@Workflow`/`@Step`
185
190
  * handlers and runs the BullMQ consumer (see {@link DurableWorkerModule}).
186
191
  */
187
192
  interface DurableWorkerModuleOptions {
@@ -193,6 +198,18 @@ interface DurableWorkerModuleOptions {
193
198
  prefix?: string;
194
199
  /** Stable id for this worker process in heartbeats/control. Defaults to a per-host/pid id. */
195
200
  instanceId?: string;
201
+ /**
202
+ * How many tasks each group's consumer runs concurrently (BullMQ Worker concurrency). Defaults to 1.
203
+ * Applies to every group unless overridden per-group by {@link concurrencyByGroup}. Raise it so a
204
+ * fanned-out batch (e.g. the N remote steps of a `gather`) runs in parallel instead of serially.
205
+ *
206
+ * Pass `'adaptive'` (or `{ mode:'adaptive', ... }`) to let each consumer self-tune its concurrency
207
+ * (latency gradient + RAM brake + backpressure) and publish a live status on its heartbeat.
208
+ */
209
+ concurrency?: ConcurrencyOption;
210
+ /** Per-group concurrency override, keyed by group name. Falls back to {@link concurrency} (then 1).
211
+ * Each value may itself be `'adaptive'` / `{ mode:'adaptive', ... }`. */
212
+ concurrencyByGroup?: Record<string, ConcurrencyOption>;
196
213
  }
197
214
  interface DurableWorkerModuleAsyncOptions {
198
215
  useFactory: (...args: never[]) => DurableWorkerModuleOptions | Promise<DurableWorkerModuleOptions>;
@@ -223,7 +240,7 @@ declare class ThinWorkflowRegistrar implements OnModuleInit {
223
240
  onModuleInit(): void;
224
241
  }
225
242
  /**
226
- * Discovers every `@DurableStep` method and registers it as a step handler on the thin
243
+ * Discovers every `@Step` method and registers it as a step handler on the thin
227
244
  * {@link DurableWorkerRuntime}. Mirrors the engine-side `DurableStepRegistrar`, but always registers
228
245
  * on the runtime (a thin worker IS the consumer — there is no in-process-vs-queue branch).
229
246
  */
@@ -254,7 +271,7 @@ declare class ThinWorkerBootstrap implements OnApplicationBootstrap, OnApplicati
254
271
  }
255
272
  /**
256
273
  * A NestJS dynamic module that turns an app into a **PURE durable worker**: it discovers
257
- * `@Workflow`/`@DurableStep` providers, registers them on the thin {@link DurableWorkerRuntime}, and
274
+ * `@Workflow`/`@Step` providers, registers them on the thin {@link DurableWorkerRuntime}, and
258
275
  * runs one BullMQ consumer per group via `runRedisWorker`. It is **control-plane-less** — it binds
259
276
  * NO `WorkflowEngine`, NO store/ORM, NO dashboard, NO timer poller, NO recovery, and NO run dispatch.
260
277
  * Use it for a worker pod that only executes work an engine elsewhere coordinates.
@@ -270,7 +287,7 @@ declare class DurableWorkerModule {
270
287
 
271
288
  /**
272
289
  * Opt-in config for an **in-app worker**: the same NestJS process runs the engine AND serves its own
273
- * discovered `@Workflow`/`@DurableStep` on one default `group`. The engine registers each `@Workflow`
290
+ * discovered `@Workflow`/`@Step` on one default `group`. The engine registers each `@Workflow`
274
291
  * GROUP-SERVED (its turns are dispatched to `group` over the transport via a {@link RemoteWorkflowExecutor}
275
292
  * instead of run inline), and a co-located {@link DurableWorkerRuntime} consumes `group` and replays the
276
293
  * very same TS bodies. This is the uniform-dispatch "one app, both roles" shape — every turn pays a
@@ -286,6 +303,15 @@ interface DurableInAppWorkerOptions {
286
303
  prefix?: string;
287
304
  /** Stable id for this worker process in heartbeats/control. Defaults to a per-host/pid id. */
288
305
  instanceId?: string;
306
+ /**
307
+ * How many tasks the co-located worker runs concurrently from its group's queue (BullMQ Worker
308
+ * concurrency). Defaults to 1. Raise it so a fanned-out batch (e.g. the N remote steps of a
309
+ * `gather`) runs in parallel. Per process; total parallelism is `concurrency × replicas`.
310
+ *
311
+ * Pass `'adaptive'` (or `{ mode:'adaptive', ... }`) to let the worker self-tune its concurrency
312
+ * (latency gradient + RAM brake + backpressure) and publish a live status on its heartbeat.
313
+ */
314
+ concurrency?: ConcurrencyOption;
289
315
  }
290
316
  /** The resolved {@link DurableInAppWorkerOptions} or `null` when the app didn't opt in. */
291
317
  declare const IN_APP_WORKER_OPTIONS: unique symbol;
@@ -309,7 +335,7 @@ interface InAppWorkerBinding {
309
335
  executor: WorkflowExecutor;
310
336
  }
311
337
  /**
312
- * The consumer half of the in-app worker: on init it registers every discovered `@Workflow`/`@DurableStep`
338
+ * The consumer half of the in-app worker: on init it registers every discovered `@Workflow`/`@Step`
313
339
  * on a {@link DurableWorkerRuntime} (the SAME bodies the engine registered group-served), and on bootstrap
314
340
  * it starts one `runRedisWorker` consumer on the configured group, closing it on shutdown. A no-op when
315
341
  * the app didn't opt in. Mirrors the thin {@link import('./durable-worker.module').DurableWorkerModule},
@@ -419,7 +445,7 @@ interface DurableModuleOptions {
419
445
  */
420
446
  deadLetterWorkflow?: WorkflowRef;
421
447
  /**
422
- * Whether this instance plays the **worker** role: register `@DurableStep` handlers (consume the
448
+ * Whether this instance plays the **worker** role: register `@Step` handlers (consume the
423
449
  * transport), recover incomplete runs on boot, and poll due timers. Defaults to `true`. Set
424
450
  * `false` for a **dashboard/dispatch-only** instance (e.g. an API pod) that mounts the control
425
451
  * plane and reads the store but must not process or recover workflows — leave that to the workers.
@@ -486,7 +512,7 @@ interface DurableModuleOptions {
486
512
  compensationRetries?: number;
487
513
  /**
488
514
  * Opt into an **in-app worker** (uniform dispatch): the same process runs the engine AND serves its
489
- * own discovered `@Workflow`/`@DurableStep` on one default `group`. Each `@Workflow` is registered
515
+ * own discovered `@Workflow`/`@Step` on one default `group`. Each `@Workflow` is registered
490
516
  * GROUP-SERVED — its turns are dispatched to `group` over the transport and replayed by a co-located
491
517
  * worker consumer — instead of run inline. Requires a workflow-task transport (BullMQ). Omit (the
492
518
  * default) to keep every `@Workflow` on the inline fast path with zero dispatch round-trips. See
@@ -630,4 +656,4 @@ declare class WorkflowService {
630
656
  }): Promise<number>;
631
657
  }
632
658
 
633
- export { CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_OPTIONS, DURABLE_WORKER_RUNNERS, DeadLetter, type DurableInAppWorkerOptions, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableRetentionOptions, DurableStep, type DurableStepInterceptor, type DurableStepMeta, DurableWorkerModule, type DurableWorkerModuleAsyncOptions, type DurableWorkerModuleOptions, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_OPTIONS, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, ON_EVENT_METADATA, On, OnEvent, RUN_REDIS_WORKER, type RunRedisWorkerFn, STEP_INTERCEPTOR_METADATA, StepInterceptor, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowMeta, type WorkflowOptions, WorkflowService, entityConfigFor, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isStepInterceptor };
659
+ export { CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_OPTIONS, DURABLE_WORKER_RUNNERS, DeadLetter, type DurableInAppWorkerOptions, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableRetentionOptions, DurableStep, type DurableStepInterceptor, type DurableStepMeta, DurableWorkerModule, type DurableWorkerModuleAsyncOptions, type DurableWorkerModuleOptions, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_OPTIONS, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, ON_EVENT_METADATA, On, OnEvent, RUN_REDIS_WORKER, type RunRedisWorkerFn, STEP_INTERCEPTOR_METADATA, Step, StepInterceptor, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowMeta, type WorkflowOptions, WorkflowService, entityConfigFor, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isStepInterceptor };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { StepError, WorkflowRef, SingletonConfig, WorkflowExecutor, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowEngine, EntityHandler, StepInvocation, WorkflowClass, WorkflowInputOf, StartOptions, RunResult } from '@dudousxd/nestjs-durable-core';
2
- import { RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
2
+ import { ConcurrencyOption, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
3
3
  import { DynamicModule, InjectionToken, OnModuleInit, OnApplicationBootstrap, OnApplicationShutdown, Provider } from '@nestjs/common';
4
4
  import { DiscoveryService, MetadataScanner } from '@nestjs/core';
5
5
 
@@ -138,7 +138,12 @@ interface DurableStepMeta {
138
138
  * (e.g. the event-emitter transport) routes dispatched tasks to it. The method's single
139
139
  * argument is the step input; its return value is the step output.
140
140
  */
141
- declare function DurableStep(name: string): MethodDecorator;
141
+ declare function Step(name: string): MethodDecorator;
142
+ /**
143
+ * @deprecated Use `@Step` instead. `@DurableStep` is a back-compat alias of {@link Step} and
144
+ * writes the same `DURABLE_STEP_METADATA`, so discovery/registrars treat them identically.
145
+ */
146
+ declare const DurableStep: typeof Step;
142
147
  declare function getDurableStepMeta(method: Function): DurableStepMeta | undefined;
143
148
  declare const DEAD_LETTER_METADATA: unique symbol;
144
149
  /**
@@ -181,7 +186,7 @@ declare function getOnEvents(meta: WorkflowMeta, target: object): string[];
181
186
  /**
182
187
  * Options for a **store-less thin worker** process: where to consume (`connection`/`prefix`) and
183
188
  * which worker `groups` this process serves. There is deliberately NO `store`, `transport`, engine,
184
- * dashboard, recovery, or timer config — a thin worker only registers `@Workflow`/`@DurableStep`
189
+ * dashboard, recovery, or timer config — a thin worker only registers `@Workflow`/`@Step`
185
190
  * handlers and runs the BullMQ consumer (see {@link DurableWorkerModule}).
186
191
  */
187
192
  interface DurableWorkerModuleOptions {
@@ -193,6 +198,18 @@ interface DurableWorkerModuleOptions {
193
198
  prefix?: string;
194
199
  /** Stable id for this worker process in heartbeats/control. Defaults to a per-host/pid id. */
195
200
  instanceId?: string;
201
+ /**
202
+ * How many tasks each group's consumer runs concurrently (BullMQ Worker concurrency). Defaults to 1.
203
+ * Applies to every group unless overridden per-group by {@link concurrencyByGroup}. Raise it so a
204
+ * fanned-out batch (e.g. the N remote steps of a `gather`) runs in parallel instead of serially.
205
+ *
206
+ * Pass `'adaptive'` (or `{ mode:'adaptive', ... }`) to let each consumer self-tune its concurrency
207
+ * (latency gradient + RAM brake + backpressure) and publish a live status on its heartbeat.
208
+ */
209
+ concurrency?: ConcurrencyOption;
210
+ /** Per-group concurrency override, keyed by group name. Falls back to {@link concurrency} (then 1).
211
+ * Each value may itself be `'adaptive'` / `{ mode:'adaptive', ... }`. */
212
+ concurrencyByGroup?: Record<string, ConcurrencyOption>;
196
213
  }
197
214
  interface DurableWorkerModuleAsyncOptions {
198
215
  useFactory: (...args: never[]) => DurableWorkerModuleOptions | Promise<DurableWorkerModuleOptions>;
@@ -223,7 +240,7 @@ declare class ThinWorkflowRegistrar implements OnModuleInit {
223
240
  onModuleInit(): void;
224
241
  }
225
242
  /**
226
- * Discovers every `@DurableStep` method and registers it as a step handler on the thin
243
+ * Discovers every `@Step` method and registers it as a step handler on the thin
227
244
  * {@link DurableWorkerRuntime}. Mirrors the engine-side `DurableStepRegistrar`, but always registers
228
245
  * on the runtime (a thin worker IS the consumer — there is no in-process-vs-queue branch).
229
246
  */
@@ -254,7 +271,7 @@ declare class ThinWorkerBootstrap implements OnApplicationBootstrap, OnApplicati
254
271
  }
255
272
  /**
256
273
  * A NestJS dynamic module that turns an app into a **PURE durable worker**: it discovers
257
- * `@Workflow`/`@DurableStep` providers, registers them on the thin {@link DurableWorkerRuntime}, and
274
+ * `@Workflow`/`@Step` providers, registers them on the thin {@link DurableWorkerRuntime}, and
258
275
  * runs one BullMQ consumer per group via `runRedisWorker`. It is **control-plane-less** — it binds
259
276
  * NO `WorkflowEngine`, NO store/ORM, NO dashboard, NO timer poller, NO recovery, and NO run dispatch.
260
277
  * Use it for a worker pod that only executes work an engine elsewhere coordinates.
@@ -270,7 +287,7 @@ declare class DurableWorkerModule {
270
287
 
271
288
  /**
272
289
  * Opt-in config for an **in-app worker**: the same NestJS process runs the engine AND serves its own
273
- * discovered `@Workflow`/`@DurableStep` on one default `group`. The engine registers each `@Workflow`
290
+ * discovered `@Workflow`/`@Step` on one default `group`. The engine registers each `@Workflow`
274
291
  * GROUP-SERVED (its turns are dispatched to `group` over the transport via a {@link RemoteWorkflowExecutor}
275
292
  * instead of run inline), and a co-located {@link DurableWorkerRuntime} consumes `group` and replays the
276
293
  * very same TS bodies. This is the uniform-dispatch "one app, both roles" shape — every turn pays a
@@ -286,6 +303,15 @@ interface DurableInAppWorkerOptions {
286
303
  prefix?: string;
287
304
  /** Stable id for this worker process in heartbeats/control. Defaults to a per-host/pid id. */
288
305
  instanceId?: string;
306
+ /**
307
+ * How many tasks the co-located worker runs concurrently from its group's queue (BullMQ Worker
308
+ * concurrency). Defaults to 1. Raise it so a fanned-out batch (e.g. the N remote steps of a
309
+ * `gather`) runs in parallel. Per process; total parallelism is `concurrency × replicas`.
310
+ *
311
+ * Pass `'adaptive'` (or `{ mode:'adaptive', ... }`) to let the worker self-tune its concurrency
312
+ * (latency gradient + RAM brake + backpressure) and publish a live status on its heartbeat.
313
+ */
314
+ concurrency?: ConcurrencyOption;
289
315
  }
290
316
  /** The resolved {@link DurableInAppWorkerOptions} or `null` when the app didn't opt in. */
291
317
  declare const IN_APP_WORKER_OPTIONS: unique symbol;
@@ -309,7 +335,7 @@ interface InAppWorkerBinding {
309
335
  executor: WorkflowExecutor;
310
336
  }
311
337
  /**
312
- * The consumer half of the in-app worker: on init it registers every discovered `@Workflow`/`@DurableStep`
338
+ * The consumer half of the in-app worker: on init it registers every discovered `@Workflow`/`@Step`
313
339
  * on a {@link DurableWorkerRuntime} (the SAME bodies the engine registered group-served), and on bootstrap
314
340
  * it starts one `runRedisWorker` consumer on the configured group, closing it on shutdown. A no-op when
315
341
  * the app didn't opt in. Mirrors the thin {@link import('./durable-worker.module').DurableWorkerModule},
@@ -419,7 +445,7 @@ interface DurableModuleOptions {
419
445
  */
420
446
  deadLetterWorkflow?: WorkflowRef;
421
447
  /**
422
- * Whether this instance plays the **worker** role: register `@DurableStep` handlers (consume the
448
+ * Whether this instance plays the **worker** role: register `@Step` handlers (consume the
423
449
  * transport), recover incomplete runs on boot, and poll due timers. Defaults to `true`. Set
424
450
  * `false` for a **dashboard/dispatch-only** instance (e.g. an API pod) that mounts the control
425
451
  * plane and reads the store but must not process or recover workflows — leave that to the workers.
@@ -486,7 +512,7 @@ interface DurableModuleOptions {
486
512
  compensationRetries?: number;
487
513
  /**
488
514
  * Opt into an **in-app worker** (uniform dispatch): the same process runs the engine AND serves its
489
- * own discovered `@Workflow`/`@DurableStep` on one default `group`. Each `@Workflow` is registered
515
+ * own discovered `@Workflow`/`@Step` on one default `group`. Each `@Workflow` is registered
490
516
  * GROUP-SERVED — its turns are dispatched to `group` over the transport and replayed by a co-located
491
517
  * worker consumer — instead of run inline. Requires a workflow-task transport (BullMQ). Omit (the
492
518
  * default) to keep every `@Workflow` on the inline fast path with zero dispatch round-trips. See
@@ -630,4 +656,4 @@ declare class WorkflowService {
630
656
  }): Promise<number>;
631
657
  }
632
658
 
633
- export { CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_OPTIONS, DURABLE_WORKER_RUNNERS, DeadLetter, type DurableInAppWorkerOptions, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableRetentionOptions, DurableStep, type DurableStepInterceptor, type DurableStepMeta, DurableWorkerModule, type DurableWorkerModuleAsyncOptions, type DurableWorkerModuleOptions, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_OPTIONS, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, ON_EVENT_METADATA, On, OnEvent, RUN_REDIS_WORKER, type RunRedisWorkerFn, STEP_INTERCEPTOR_METADATA, StepInterceptor, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowMeta, type WorkflowOptions, WorkflowService, entityConfigFor, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isStepInterceptor };
659
+ export { CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_OPTIONS, DURABLE_WORKER_RUNNERS, DeadLetter, type DurableInAppWorkerOptions, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableRetentionOptions, DurableStep, type DurableStepInterceptor, type DurableStepMeta, DurableWorkerModule, type DurableWorkerModuleAsyncOptions, type DurableWorkerModuleOptions, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_OPTIONS, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, ON_EVENT_METADATA, On, OnEvent, RUN_REDIS_WORKER, type RunRedisWorkerFn, STEP_INTERCEPTOR_METADATA, Step, StepInterceptor, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowMeta, type WorkflowOptions, WorkflowService, entityConfigFor, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isStepInterceptor };
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ function getWorkflowMeta(target) {
39
39
  }
40
40
  __name(getWorkflowMeta, "getWorkflowMeta");
41
41
  var DURABLE_STEP_METADATA = Symbol("nestjs-durable:step-handler");
42
- function DurableStep(name) {
42
+ function Step(name) {
43
43
  return (_target, _propertyKey, descriptor) => {
44
44
  const meta = {
45
45
  name
@@ -48,7 +48,8 @@ function DurableStep(name) {
48
48
  return descriptor;
49
49
  };
50
50
  }
51
- __name(DurableStep, "DurableStep");
51
+ __name(Step, "Step");
52
+ var DurableStep = Step;
52
53
  function getDurableStepMeta(method) {
53
54
  return Reflect.getMetadata(DURABLE_STEP_METADATA, method);
54
55
  }
@@ -218,6 +219,9 @@ var ThinWorkerBootstrap = class {
218
219
  } : {},
219
220
  ...this.options.instanceId !== void 0 ? {
220
221
  instanceId: this.options.instanceId
222
+ } : {},
223
+ ...(this.options.concurrencyByGroup?.[group] ?? this.options.concurrency) !== void 0 ? {
224
+ concurrency: this.options.concurrencyByGroup?.[group] ?? this.options.concurrency
221
225
  } : {}
222
226
  });
223
227
  this.runners.push(handle);
@@ -508,6 +512,9 @@ var InAppWorkerBootstrap = class {
508
512
  } : {},
509
513
  ...this.options.instanceId !== void 0 ? {
510
514
  instanceId: this.options.instanceId
515
+ } : {},
516
+ ...this.options.concurrency !== void 0 ? {
517
+ concurrency: this.options.concurrency
511
518
  } : {}
512
519
  });
513
520
  this.runners.push(handle);
@@ -1205,6 +1212,7 @@ export {
1205
1212
  OnEvent,
1206
1213
  RUN_REDIS_WORKER,
1207
1214
  STEP_INTERCEPTOR_METADATA,
1215
+ Step,
1208
1216
  StepInterceptor,
1209
1217
  ThinStepRegistrar,
1210
1218
  ThinWorkerBootstrap,