We would like to support publishing messages with a specific pattern, such as logs.{level}.
Here is an example of how this could be implemented:
publisher = broker.publisher("logs.{level}")
await publisher.publish("Hi!", level="info") # should be interpreted as "logs.info" destination
Suggested implementation:
async def publish(self, message: SendableMessage, **kwargs: Any) -> None:
dest = self.destination.format(**kwargs)
await self._publish(message, dest)
As a reference we can use current compile_path function using for pattern-based subscribers: https://github.com/search?q=repo%3Aag2ai%2Ffaststream%20compile_path&type=code
We would like to support publishing messages with a specific pattern, such as
logs.{level}.Here is an example of how this could be implemented:
Suggested implementation:
As a reference we can use current
compile_pathfunction using for pattern-based subscribers: https://github.com/search?q=repo%3Aag2ai%2Ffaststream%20compile_path&type=code