broadcaster icon indicating copy to clipboard operation
broadcaster copied to clipboard

Support for pattern based topic in kafka

Open woile opened this issue 5 years ago • 1 comments

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.

woile avatar Feb 26 '20 12:02 woile

API matches up with what I'd expect, yup.

lovelydinosaur avatar Feb 26 '20 12:02 lovelydinosaur