Skip to content

feat(platform): let a worker spec ask for a batch - #301

Merged
levivannoort merged 1 commit into
mainfrom
feat/platform-queue-3
Sep 18, 2026
Merged

levivannoort merged 1 commit into
mainfrom
feat/platform-queue-3

Conversation

@levivannoort

Copy link
Copy Markdown
Contributor

Server::job() has taken a batch size since queue 3.0.0, but every worker boots through Platform::initWorker(), which called job() with two arguments. The parameter was unreachable from an application, so no queue could claim more than one message per receive no matter what it configured.

jobs entries now carry an optional batch alongside queue and maxCoroutines, defaulting to 1 — the behaviour every caller has today.

The constraint moves in the same commit: queue 3.0.0 adds rightPopMany() and incrementBy() to Connection, which platform neither implements nor calls. It uses Adapter\\Swoole and Server, both unchanged across the major, so ^3.0.0 joins the existing list rather than replacing it.

Needed by appwrite/appwrite, which pins platform exactly and cannot take queue 3.0.0 until this releases as 1.0.0-rc21.

Server::job() has taken a batch size since queue 3.0, but every worker
boots through initWorker(), which called job() with two arguments -- so
the parameter was unreachable from an application and no queue could ask
for more than one message per receive.

The constraint moves with it: queue 3.0 adds two methods to Connection,
which platform neither implements nor calls, so nothing here changes for
the major.
@levivannoort
levivannoort merged commit a02725f into main Sep 18, 2026
5 checks passed
pull Bot pushed a commit to Zezo-Ai/ZezoAi-appwrite that referenced this pull request Sep 18, 2026
The major adds rightPopMany() and incrementBy() to Connection, which is
the whole of its breaking surface here: InMemoryConnection is the only
implementation in this repository, and WorkerConcurrencyTest drives it.
Consumer is unchanged, so FakeConsumer in InitJobsTest needs nothing.

3.0 brings PermanentFailure (a handler can end a message's life rather
than spend its whole redelivery budget on work that cannot succeed), a
pluggable envelope codec, and batched receive -- none of which this
commit takes up. It moves the floor so applications built on server-ce
can.

The lock is not updated yet: utopia-php/platform 1.0.0-rc20 caps queue
at ^2.0.0, so this needs rc21 (utopia-php/monorepo#301) first.
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.

2 participants