@semiont/jobs 0.5.37 → 0.5.39

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.
@@ -9268,7 +9268,6 @@ function createJobClaimAdapter(options) {
9268
9268
  start: () => {
9269
9269
  if (started) return;
9270
9270
  started = true;
9271
- bus.addChannels?.(["job:queued"]);
9272
9271
  jobSubscription = bus.stream("job:queued").subscribe((event) => {
9273
9272
  lastQueuedEventAt = Date.now();
9274
9273
  const jobType = event.jobType;
@@ -11501,7 +11500,6 @@ function startWorkerProcess(config) {
11501
11500
  const completedUnitsByJob = /* @__PURE__ */ new Map();
11502
11501
  const unitCursorsByJob = /* @__PURE__ */ new Map();
11503
11502
  let activeCancel = null;
11504
- httpTransport.actor.addChannels?.(["job:cancel-requested"]);
11505
11503
  httpTransport.on("job:cancel-requested", (event) => {
11506
11504
  const targetId = event.jobId;
11507
11505
  if (targetId && activeCancel?.jobId === targetId) {
@@ -11961,7 +11959,16 @@ var WORKER_AWAITED_OPERATIONS = [
11961
11959
  // rare error path is no reason to let it back in.
11962
11960
  "browse:annotation-requested"
11963
11961
  ];
11964
- var WORKER_CHANNELS = replyChannelsFor(WORKER_AWAITED_OPERATIONS);
11962
+ var WORKER_CONSUMED_BROADCASTS = [
11963
+ // The queue announcement the claim adapter races for.
11964
+ "job:queued",
11965
+ // Cooperative cancellation of the ACTIVE job (JOB-RESTART-SAFETY P4).
11966
+ "job:cancel-requested"
11967
+ ];
11968
+ var WORKER_CHANNELS = [
11969
+ ...replyChannelsFor(WORKER_AWAITED_OPERATIONS),
11970
+ ...WORKER_CONSUMED_BROADCASTS
11971
+ ];
11965
11972
  function parseGatewayUrl(url) {
11966
11973
  const parsed = new URL(url);
11967
11974
  const protocol = parsed.protocol.replace(":", "") === "https" ? "https" : "http";