@colony2/c2j 0.0.70 → 0.0.72

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.
Files changed (2) hide show
  1. package/README.md +6 -45
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -57,8 +57,6 @@ c2j submit
57
57
  c2j run
58
58
  c2j run one
59
59
  c2j run with-lease
60
- c2j run any
61
- c2j run loop
62
60
  c2j ready
63
61
  c2j list
64
62
  c2j test
@@ -551,56 +549,19 @@ the job becomes runnable or the wait timeout is reached.
551
549
  - `4`: job not runnable under the selected policy
552
550
  - `5`: invalid job identity or invalid run arguments
553
551
 
554
- ## Worker Modes
552
+ ## Dispatching work
555
553
 
556
- `c2j run loop` runs a long-lived worker for one tenant. It leases available jobs
557
- from a remote JobDB runtime and executes up to the configured local concurrency.
554
+ Run a known job with `c2j run --job-id <id>`, or let a dispatcher such as Pulse
555
+ claim a lease and launch [`c2j run with-lease`](GUIDE-Run-With-Lease.md).
556
+ `run any` and `run loop` are no longer supported.
558
557
 
559
- Basic usage:
560
-
561
- ```bash
562
- c2j run loop --jobdb http://localhost:9047/<tenant-id> --concurrency 4
563
- ```
564
-
565
- Important behavior:
566
-
567
- - `--concurrency <n>` controls how many jobs this process can run at once
568
- - `--jobdb` must be a remote `http://host/tenant` or `https://host/tenant` URI
569
- - `--embed` is not available for `run loop`
570
- - `--jobdb embed:///` is rejected for `run loop`
571
- - `run loop` is non-interactive; use `run` or an ops surface for jobs that need input
572
-
573
- ### Loose scheduling with `ready` and `run any`
574
-
575
- `c2j ready` prints the number of currently ready recipe jobs for one tenant:
558
+ `c2j ready` prints a read-only snapshot of the number of ready recipe jobs:
576
559
 
577
560
  ```bash
578
561
  c2j ready --jobdb http://localhost:9047/<tenant-id>
579
562
  ```
580
563
 
581
- `c2j run any` atomically polls for one available item of recipe work, leases it,
582
- runs it, and exits. If no lease is available, it exits successfully after
583
- printing `no jobs found`.
584
-
585
- ```bash
586
- c2j run any --jobdb http://localhost:9047/<tenant-id>
587
- ```
588
-
589
- These can be composed by an external scheduler:
590
-
591
- ```bash
592
- count=$(c2j ready --jobdb http://localhost:9047/<tenant-id>)
593
- if [ "$count" -gt 0 ]; then
594
- for _ in $(seq 1 "$count"); do
595
- c2j run any --jobdb http://localhost:9047/<tenant-id> &
596
- done
597
- wait
598
- fi
599
- ```
600
-
601
- `ready` is only a non-mutating snapshot and can become stale under competing
602
- workers. `run any` uses JobDB polling so finding available work and acquiring the
603
- lease happen in one runtime operation.
564
+ The count is not a reservation and may change before a dispatcher claims work.
604
565
 
605
566
  ## Listing Jobs
606
567
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colony2/c2j",
3
- "version": "0.0.70",
3
+ "version": "0.0.72",
4
4
  "description": "c2j job system",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/colony-2/c2j",