dbos-inc / dbos-transact

The TypeScript framework for backends that scale
https://docs.dbos.dev
MIT License
335 stars 22 forks source link

Add support for subscribing to topics by regex #433

Closed demetris-manikas closed 3 months ago

demetris-manikas commented 3 months ago

kafkajs provides support for it so why not expose it?

This can be extended so as to receive an Array<string | RegExp> instead of just one.

demetris-manikas commented 3 months ago

Rebased and waiting review

demetris-manikas commented 3 months ago

Suggestions applied

demetris-manikas commented 3 months ago

Happy to help. I guess you are not interested in implementing the topics functionality along with topic since you did not comment on it.

kraftp commented 3 months ago

I think that would also be a good change, if slightly more involved

demetris-manikas commented 3 months ago

Shoot.. The 'topic' way is deprecated. Should have been an array from the start, I guess it is too late to change the Decorator so I have to create another one or have topic defined as string | RegExp | Array<string | RegExp> which is not that bad except for the variable name. Apart from that the implementation is quite easy. Which way you recommend?

kraftp commented 3 months ago

Defining topic in our decorator as string | RegExp | Array<string | RegExp> makes the most sense to me.