class List[str], credentials_file: Optional[str] = None, *args, **kwargs)[source]

Bases: Backend

Subscribe to a list of topics on a Google Pub/Sub instance. See for a reference on how to generate your project and credentials file.



  • google-cloud-pubsub (pip install google-cloud-pubsub)

__init__(topics: List[str], credentials_file: Optional[str] = None, *args, **kwargs)[source]
  • topics – List of topics to subscribe. You can either specify the full topic name in the format projects/<project_id>/topics/<topic_name>, where <project_id> must be the ID of your Google Pub/Sub project, or just <topic_name> - in such case it’s implied that you refer to the topic_name under the project_id of your service credentials.

  • credentials_file – Path to the Pub/Sub service credentials file (default: value configured on the google.pubsub plugin or ~/.credentials/platypush/google/pubsub.json).


Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.