A small utility class for connecting two Google Cloud Pubsub queues with a data processing component .
pip install -e git+http://github.com/hypefactors/[email protected]#egg=pubsub_pipeline
from pubsub_pipeline import PubSubPipeline
def processor(data: dict) -> dict:
data['result'] = "Processing result"
return data
if __name__ == '__main__':
PubSubPipeline(
processor=processor,
google_cloud_project='some-project-name',
incoming_subscription='some/subscription/path',
outgoing_topic='some-topic'
).process()