-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Kafka::asyncPublish() that will not flush on each send/batchSend but only once when the application is terminating #310
Conversation
…ication) [see discussion mateusjunges#309]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sash! I left some small tweaks. I'm still testing this before I make any decisions, but it makes me want to remove support for batch publishing messages.
Merging into the |
I thought of something I didn't do - I need to have a singleton in order to keep a singular instance of the builder, so that even if you call Kafka::asyncPublish multiple times, you will still get the same instance that will have the same publisher. The current implementation creates multiple publishers and has each of them being flushed when the app terminates, and its up to the user to reuse the builder in his/hers code. Perhaps we should have an argument $async = false for the Factory->produce method (instead of a standalone asyncPublish that feals clunky to me). And we should also have a Factory->defaultProducer that will use the container to return a singleton instance of an async producer builder? |
* Introduce Kafka::asyncPublish() that will not flush on each send/batchSend but only once when the application is terminating (#310) * upd: async production (that has only one flush at the end of the application) [see discussion #309] * fix: added broker parameter to the facade helper [see discussion #309] * ref: simplify Builder construct extension [see discussion #309] --------- Co-authored-by: Alexander (SASh) Alexiev <[email protected]> * wip * Deprecate batch messages * Docs * wip * wip * wip * wip * Update docs for v2 * Remove cache folder * Update gitignore * Store the builder in memory * Add tests * Update tests --------- Co-authored-by: SASh <[email protected]> Co-authored-by: Alexander (SASh) Alexiev <[email protected]>
See discussion #309