docs(queues): document sending at an instant and the scheduled work pattern in the README in @observerly/orderly - #71
Merged
Conversation
…attern in the README in @observerly/orderly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This Changes
atoption onsend()andsendBatch(): 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.MAXIMUM_DELAY_SECONDSnames, is refused rather than moved; an instant besidedelaySecondsis refused; an invalid Date is refused; each with aRangeError.delaySecondson its own stays floored and clamped into the platform's bounds.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
src/queues/producer.ts: the instant is read before the parse and the clock after it,secondsUntilrounds up and floors at zero, and the three refusals are the onesinstantOfandsecondsUntilraise.@cloudflare/workers-typeswith the surrounding declarations filled in, so thesendandsendBatchsignatures shown are the real ones.Checklist