Skip to content

docs(queues): document sending at an instant and the scheduled work pattern in the README in @observerly/orderly - #71

Merged
michealroberts merged 1 commit into
mainfrom
docs/queues/scheduled-work
Sep 9, 2026
Merged

michealroberts merged 1 commit into
mainfrom
docs/queues/scheduled-work

Conversation

@michealroberts

Copy link
Copy Markdown
Member

What This Changes

  • Adds a "Scheduled Work" section to the README, between Observability and Schedules, documenting the at option on send() and sendBatch(): the seconds until the instant are counted at hand-over, after the body is validated, and rounded up, so a message never arrives early; an instant already passed sends at once; a batch takes one instant for all of its bodies.
  • States the refusals as the producer makes them: an instant further off than the day a queue holds a message back, which MAXIMUM_DELAY_SECONDS names, is refused rather than moved; an instant beside delaySeconds is refused; an invalid Date is refused; each with a RangeError. delaySeconds on its own stays floored and clamped into the platform's bounds.
  • Describes the pattern for work further off than a day: a schedule and a daily cron trigger hand the coming day's occurrences to the queue with at, one message a job, the consumer starts one Workflow per message as it lands, and the Workflow does the work at once rather than sleeping until it is due. It links to The Sun, where the worker example already shows the whole arrangement.

Notes For Reviewers

  • README only, with an empty changeset. Every claim was checked against src/queues/producer.ts: the instant is read before the parse and the clock after it, secondsUntil rounds up and floors at zero, and the three refusals are the ones instantOf and secondsUntil raise.
  • The snippet was typechecked against orderly's source and @cloudflare/workers-types with the surrounding declarations filled in, so the send and sendBatch signatures shown are the real ones.
  • The section deliberately does not repeat the cron-and-Workflow worker; The Sun already carries it, and one copy is easier to keep true than two.

Checklist

  • Tests cover the change, and run inside workerd
  • A changeset is included, or the change is not one a consumer would notice
  • No Node built-ins were introduced

@michealroberts
michealroberts merged commit fc2ff51 into main Sep 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant