broadcaster
broadcaster copied to clipboard
Support for pattern based topic in kafka
A single consumer cannot read from a pattern and a normal topic. So at least 2 consumers must be created. This can be done internally, no problem here.
Now... how should the interface look?
async with broadcast.subscribe(channel="logs/*") as subscriber:
If we want to use the current channel parameter, then a Consumer should be created each
time .subscribe is called (if not mistaken).
async with broadcast.subscribe(pattern="logs/*") as subscriber:
In this case we can have 2 consumers only, but we'd have a pattern keyword
which may not be supported by every backend.
API matches up with what I'd expect, yup.