SSyncropel Docs

Your First Fan-Out

A five-minute walkthrough. Start three local workspaces, split a small task between two workers, watch it finish, check the speedup and shut down. No model costs.

This walkthrough is being revised. On current versions the workers don't pick up the subtasks, so the fan-out in step 3 doesn't finish. The fleet commands themselves are described in the CLI reference.

What you'll see

A local fleet of three workspaces (one coordinator and two workers), a parent task split into two subtasks, each worker finishing its part, the parent completing, and spl task speedup comparing parallel time with the serial estimate.

Total time: under 5 minutes. No API keys are needed (we use echo mode, which gives canned replies).

Step 1: Start the fleet

spl fleet start --workers 2

Once all three are up, you'll see output like:

fleet converged
  coordinator did:sync:instance:f93a4ad9... on :9100
  worker-a    did:sync:instance:fd29f647... on :9201
  worker-b    did:sync:instance:6e22815e... on :9202

Verify everything is live:

spl fleet list

You should see 3 rows, all live, all healthy.

Step 2: Create a parent task

spl task add "My first fan-out" --priority high --alias FIRST-001

Output:

◇ Task created: My first fan-out
  thread: th_abc123...
  alias:  FIRST-001

Copy the worker DIDs from spl fleet list. You'll paste them into the next command.

Step 3: Fan out to both workers

Replace <WORKER_A_DID> and <WORKER_B_DID> with the actual DIDs from step 1.

spl task fan-out FIRST-001 \
  --subtask "goal=do thing A,target=specific:<WORKER_A_DID>" \
  --subtask "goal=do thing B,target=specific:<WORKER_B_DID>" \
  --join all

Output:

◇ Fan-out parent created
  thread:   th_abc123...
  record:   <id>
  subtasks: 2
  join:     all

Each worker gets its own subtask. Because the workers are in echo mode (the default for local fleets), they finish almost immediately with canned results.

Step 4: Watch the join

spl task join-status FIRST-001
Fan-out join status: th_abc123...
  Subtasks:        2
  Spawned:         2 / 2
  Completed:       2 / 2
  Join predicate:  all
  Join complete:   yes

  Per-subtask:
    [0] do thing A → specific:did:sync:instance:fd29f647...
        accept ($0.00, 1s)
    [1] do thing B → specific:did:sync:instance:6e22815e...
        accept ($0.00, 1s)

All subtasks are done, so the parent is done.

Step 5: Inspect the speedup

spl task speedup FIRST-001
Fan-out speedup report: th_abc123...

  Parallel run:
    subtasks:          2
    per-subtask walls: [1, 1]
    parallel wall:     1s  (critical path = max)
    total cost:        $0.0000

  Weak estimate (single-run, sanity check only):
    serial estimate:   2s  (sum of subtask walls)
    estimated speedup: 2.00×
    caveat:            summing subtask walls is a sanity check, not a
                       rigorous measurement. For a clean comparison, run
                       the same workload serially and pass the resulting
                       thread via `--vs-serial <thread>`.

In echo mode every subtask takes about 1 second, so the ratio tells you little. In a real fan-out with real subtasks, this is where you see whether running in parallel saves time.

Step 6: Tear down

spl fleet stop --all

You're back to a single workspace.

What just happened

You used the four building blocks of fleets:

  1. Fleet list. spl fleet list shows the registered workspaces.
  2. Fan-out. spl task fan-out writes one parent task with a list of subtasks and sends each to its target worker.
  3. Join. The parent completes when its join rule (all, any, k_of_n, or a custom expression) is met by the subtasks.
  4. Speedup. spl task speedup reads the completion records and reports the ratio.

Next steps

On this page