Tide · Reliability

Concurrent workers

Processes that call advance on the same store do not duplicate work. A run is one row per reflex and triggering occurrence or fact, a task is one row per run and unit, and both are written before any effect executes. A second process that advances for the same occurrence finds those rows and creates and executes nothing: in the example, six mails are sent once.

Reflex
{
  id: 'theatre.reminders',
  intent: 'Remind every member at 18:00.',
  on: {
    clock: { every: 'day', at: '18:00', tz: 'Europe/Vienna' },
  },
  select: {
    query: { table: 'members' },
    mode: 'each',
    unitKey: 'id',
  },
  effect: {
    name: 'mail.send',
    input: { to: { $ref: '$.row.id' } },
  },
}
advance, process by process
Report
{ runsCreated: 1, tasksCreated: 6, executed: 6 }
Ledger rows and mail sent
{ runs: 1, tasks: 6, mailsSent: 6 }
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.