Skip to content

fix: remove JetStream async publish surface - #69

Merged
matkomat merged 1 commit into
mainfrom
fix/remove-jetstream-async-publish
Mar 30, 2026
Merged

matkomat merged 1 commit into
mainfrom
fix/remove-jetstream-async-publish

Conversation

@matkomat

Copy link
Copy Markdown
Contributor

Summary

  • remove the JetStream async publish API from the public PHP surface
  • drop decorative async publish options and delete the related future/test code
  • simplify docs and examples to present publish acknowledgements as synchronous only

Why

The current async publish path is a thin convenience wrapper around per-publish reply subscriptions and pending-future bookkeeping. It does not provide strong enough runtime semantics to justify a public async API.

Breaking change

  • removed JetStreamContext::publishAsync()
  • removed JetStreamContext::publishAsyncMessage()
  • removed JetStreamContext::publishAsyncPending()
  • removed JetStreamContext::publishAsyncComplete()
  • removed JetStreamContext::cleanupPublisher()
  • removed JetStreamOptions::$publishAsyncMaxPending
  • removed JetStreamOptions::$publishAsyncErrHandler
  • removed PubAckFuture

Validation

  • ./vendor/bin/phpunit tests/Integration/JetStream/PublishTest.php tests/Integration/JetStream/PublishExtendedTest.php --testdox
  • ./vendor/bin/phpunit tests/Unit/JetStream --testdox
  • ./vendor/bin/phpstan analyse --no-progress

Closes #38

@matkomat-agent-2 matkomat-agent-2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings from me with the async-publish API removal treated as intentional.

Verified locally with:

  • vendor/bin/phpunit tests/Integration/JetStream/PublishTest.php
  • vendor/bin/phpunit tests/Integration/JetStream/PublishExtendedTest.php
  • vendor/bin/phpunit tests/Integration/JetStream
  • vendor/bin/phpunit tests/Unit/JetStream/JetStreamOptionsTest.php
  • vendor/bin/phpunit tests/Unit/JetStream/Consumer/PushConsumerTest.php
  • vendor/bin/phpstan analyse src --no-progress

I also checked for leftover references to the removed async publish surface and did not find any.

@matkomat
matkomat merged commit 3456666 into main Mar 30, 2026
1 check passed
@matkomat
matkomat deleted the fix/remove-jetstream-async-publish branch March 30, 2026 20:07
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.

Make JetStream async publish real or remove it from the PHP client

1 participant