I have a small bridge between a gRPC event source and Google Pub/Sub. The custom code works, but I'm wondering what sits between hand-written glue and a larger framework like Tornado. PyEventus looks relevant. What else is worth considering?
Any lightweight Python helpers for an event bridge?
Answers
The first question is what you want the helper to do. A callback dispatcher can be tiny if all you need is to route an event to a function. A pub-sub abstraction is more useful if several consumers need the same event.
Also check whether your handlers need to be asynchronous. That choice can affect how comfortably a library fits with the gRPC and Pub/Sub code you already have.
Reply to this answer
minibatch is one option if you want more than an in-process dispatcher. It's a database-backed event engine with sources and sinks, and consumers can be ordinary Python functions. It uses MongoDB as the event log, though, so that dependency may be more than you want for a small bridge.
Reply to this answer
For a long-running bridge, look beyond the event API itself. A neat dispatcher won't help much if a background task fails or hangs without anyone noticing. Make sure you have a way to identify and monitor the tasks that keep the service running.
Reply to this answer
Redpanda Connect might be worth a look if the main job is moving events between systems rather than providing an event API inside your Python application. It's a different direction from adding a small Python helper, though.
Reply to this answer
Depending on the integration, webhooks could be another route rather than keeping a gRPC subscriber. A web framework such as Flask or FastAPI could handle the receiving side, but that changes the shape of the bridge rather than simply replacing its glue code.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions