Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Latest commit

 

History

History
33 lines (19 loc) · 645 Bytes

README.md

File metadata and controls

33 lines (19 loc) · 645 Bytes

pubsub_pipeline

A small utility class for connecting two Google Cloud Pubsub queues with a data processing component .

Install

pip install -e git+http://github.com/hypefactors/[email protected]#egg=pubsub_pipeline

Usage

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()