@pikku/kysely 0.13.2 → 0.13.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## 0.13.3
2
+
3
+ ### Patch Changes
4
+
5
+ - e3d4454: Add job groups, so one shared queue can stay fair without splitting into one
6
+ queue per producer.
7
+
8
+ A job may now carry `group: { id, tier }`, and a worker may cap how many jobs
9
+ of any one group run at once via `groupConcurrency`. On pg-boss this maps to
10
+ `localGroupConcurrency`, which excludes at-capacity groups from the fetch query
11
+ itself, so a capped group costs nothing rather than being fetched and restored.
12
+ BullMQ declares it unsupported (groups are a BullMQ Pro feature) — being
13
+ push-based, it can simply use a queue per group at no polling cost.
14
+
15
+ Workflow services accept a `queueStrategy`. The default `'per-workflow'` is
16
+ unchanged: every workflow gets its own `wf-orchestrator-*` / `wf-step-*` queue,
17
+ which is also what lets serverless providers deploy one unit per workflow. The
18
+ new `'shared-groups'` routes every workflow through the shared
19
+ orchestrator/step-worker queues and isolates them by group instead, so a
20
+ monolith runs one set of pollers rather than one per workflow — on a
21
+ pull-based backend with dozens of workflows that is the difference between
22
+ hundreds of poll loops and twenty. It is for single-process runtimes only; a
23
+ per-unit serverless deploy still needs the per-workflow queues to route to its
24
+ units.
25
+
26
+ - Updated dependencies [24252b8]
27
+ - Updated dependencies [e3d4454]
28
+ - @pikku/core@0.12.69
29
+
1
30
  ## 0.13.2
2
31
 
3
32
  ### Patch Changes
@@ -1,12 +1,12 @@
1
1
  import type { SerializedError } from '@pikku/core';
2
- import { PikkuWorkflowService, type WorkflowPlannedStep, type WorkflowRun, type WorkflowRunWire, type StepState, type StepStatus, type WorkflowStatus, type WorkflowVersionStatus } from '@pikku/core/workflow';
2
+ import { PikkuWorkflowService, type WorkflowPlannedStep, type WorkflowQueueOptions, type WorkflowRun, type WorkflowRunWire, type StepState, type StepStatus, type WorkflowStatus, type WorkflowVersionStatus } from '@pikku/core/workflow';
3
3
  import type { Kysely } from 'kysely';
4
4
  import type { KyselyPikkuDB } from './kysely-tables.js';
5
5
  export declare class KyselyWorkflowService extends PikkuWorkflowService {
6
6
  protected db: Kysely<KyselyPikkuDB>;
7
7
  private initialized;
8
8
  private runService;
9
- constructor(db: Kysely<KyselyPikkuDB>);
9
+ constructor(db: Kysely<KyselyPikkuDB>, options?: WorkflowQueueOptions);
10
10
  init(): Promise<void>;
11
11
  protected createRunImpl(workflowName: string, input: any, inline: boolean, graphHash: string, wire: WorkflowRunWire, options?: {
12
12
  deterministic?: boolean;
@@ -6,8 +6,8 @@ export class KyselyWorkflowService extends PikkuWorkflowService {
6
6
  db;
7
7
  initialized = false;
8
8
  runService;
9
- constructor(db) {
10
- super();
9
+ constructor(db, options = {}) {
10
+ super(options);
11
11
  this.db = db;
12
12
  this.runService = new KyselyWorkflowRunService(db);
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/kysely",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "MIT",
6
6
  "module": "dist/src/index.js",
@@ -20,7 +20,7 @@
20
20
  "prepublishOnly": "yarn build"
21
21
  },
22
22
  "peerDependencies": {
23
- "@pikku/core": "^0.12.66"
23
+ "@pikku/core": "^0.12.69"
24
24
  },
25
25
  "dependencies": {
26
26
  "kysely": "^0.29.0"
@@ -2,6 +2,7 @@ import type { SerializedError } from '@pikku/core'
2
2
  import {
3
3
  PikkuWorkflowService,
4
4
  type WorkflowPlannedStep,
5
+ type WorkflowQueueOptions,
5
6
  type WorkflowRun,
6
7
  type WorkflowRunWire,
7
8
  type StepState,
@@ -19,8 +20,11 @@ export class KyselyWorkflowService extends PikkuWorkflowService {
19
20
  private initialized = false
20
21
  private runService: KyselyWorkflowRunService
21
22
 
22
- constructor(protected db: Kysely<KyselyPikkuDB>) {
23
- super()
23
+ constructor(
24
+ protected db: Kysely<KyselyPikkuDB>,
25
+ options: WorkflowQueueOptions = {}
26
+ ) {
27
+ super(options)
24
28
  this.runService = new KyselyWorkflowRunService(db)
25
29
  }
26
30