You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we can go for option 1, and use send as a name as most of python streaming libraries has a send function.
Maybe something like this:
classProducer:
....
asyncdefsend(self, topic, value, key=None, partition=None, timestamp_ms=None, headers=None):
...
# When the topic is created and is the signature has the send argument, we inject it.asyncdefhello(stream: Stream, send: Awaitable):
asyncforvalueinstream:
awaitsend("a-topic", value)
Why do you think a singleton is needed? The kafka producer will have to be instanciated every time probably, or at least per topic, what would we gain frrom a singleton?
Activity
woile commentedon Feb 3, 2020
@marcosschroh suggestions?
[-]produce event interface[/-][+]Produce event interface[/+]marcosschroh commentedon Feb 4, 2020
I think we can go for option 1, and use
sendas a name as most of python streaming libraries has asendfunction.Maybe something like this:
What do you think?
marcosschroh commentedon Feb 4, 2020
Also, do we need a singleton for the producer ? I am seeing only one producer instance to be shared
woile commentedon Feb 4, 2020
I'm okay with
sendas keyword.Why do you think a singleton is needed? The kafka producer will have to be instanciated every time probably, or at least per topic, what would we gain frrom a singleton?
I think we should also support this behavior:
For simplicity and testing purposes