Skip to content

refactor(queue): use publishMany for synchronous batches - #317

Merged
loks0n merged 1 commit into
mainfrom
codex/queue-publish
Sep 21, 2026
Merged

loks0n merged 1 commit into
mainfrom
codex/queue-publish

Conversation

@loks0n

@loks0n loks0n commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

The synchronous publisher API used publish() for one message but enqueueMany() for a batch. Rename the batch method to publishMany() across the interface, Redis, NATS, Pool, Background, and callers. Keep enqueue() for Background's asynchronous handoff; synchronous methods still wait for broker acceptance.

This is a queue 5 API change with no forwarding alias. Custom synchronous publishers and batch callers must rename enqueueMany() to publishMany(). Documentation and tests use the same terminology. The withdrawn releases remain withdrawn.

Validation: 145 unit tests / 329 assertions; 13 Redis/NATS integration tests / 129 assertions; Pint, PHPStan, Rector and documentation lint pass.

Follow-up to #316. Tracked in https://github.com/appwrite-labs/cloud/issues/5996.

@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the intentional breaking rename is complete and preserves existing synchronous and asynchronous behavior.

Summary

This PR consistently renames the synchronous batch-publishing API from enqueueMany() to publishMany().

  • Updates the synchronous publisher interface and Redis, NATS, Pool, and Background implementations.
  • Preserves Background’s distinct asynchronous enqueue() handoff.
  • Updates internal callers, tests, and migration documentation for the intentional queue 5 breaking change.
  • No stale executable references or behavioral regressions were identified.

Reviews (1) · Last reviewed commit: "refactor(queue): name synchronous batch ..."

@github-actions

Copy link
Copy Markdown

Benchmark results

queue — workload shapes across both concurrency axes (4 cores, 600 messages, median of 3)

workload shape redis msg/s nats msg/s
io 1p x 1c x 1f 38 38
io 1p x 4c x 4f 151 150
io 4p x 1c x 1f 151 152
cpu 1p x 1c x 1f 184 183
cpu 1p x 4c x 4f 195 189
cpu 4p x 1c x 1f 440 432
mixed 1p x 1c x 1f 65 65
mixed 1p x 4c x 4f 179 176
mixed 4p x 1c x 1f 242 244
null 1p x 16c x 16f 10817 8940
null 1p x 16c x 64f 16211 16325
null 1p x 16c x 100f 15767 16846

Np x Mc x Ff = N consumer processes x M handler coroutines x a prefetch limit of F
unacknowledged messages. io yields and should follow coroutines; cpu does not and should follow
processes; mixed is in between. null has no handler at all, so it measures the broker
rather than the job -- the only row where prefetch can matter.

Shared CI runners — treat absolute numbers as rough, compare modes within a run. Commit 657ad1d.

@loks0n
loks0n merged commit 9f3306d into main Sep 21, 2026
7 checks passed
@loks0n

loks0n commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Merged #317 after all checks on d3357a86f56d35d1993288e05f9e40d58c2cecfe passed, including Greptile and benchmarks. No unresolved review threads on #317. Merge commit: 9f3306dcb52eca78b98c7e9e194d274f567224ec.

Published from that merge commit and verified in Packagist:

  • Queue 5.0.1, mirror commit 4b2ed53ccca837f907fa8b16e325a7ae50af268a. Verified the published interface exposes publish() and publishMany(); enqueue() remains asynchronous handoff.
  • Platform 1.0.0-rc24, mirror commit faa60fd42bc62d98f7433c6a8f03dd6991a48d8b, requiring queue ^5.0.0 (resolves to the available 5.0.1 release).

The withdrawn queue 5.0.0 and Platform 1.0.0-rc23 remain withdrawn. Fresh versions avoid replacing an already-published version with different contents.

CI tests: 145 queue unit tests / 329 assertions; 151 queue integration tests / 743 assertions; 11 linked Platform tests / 92 assertions. Validation, static checks, benchmark, and both release split workflows passed.

Application package-lock/configuration updates and deployment remain separate follow-ups. No application deployment or deployment-default change was performed. Release notes include the API migration, retention, and rollback details.

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