This is just a simple demo of publishing messags to a pubsub topic and then running a subscriber to pull the data. There are 2 ways to subscribe: async and sync. Both methods are included in the subscriber.py. Just comment/uncomment the appropriate lines.
Create a topic ticker and subscriber ticker-sub
Create the virtual environment
> virtualenv venv
Activate the venv
> source venv/bin/activate
Deactivate venv
> deactivate
pip install --upgrade google-cloud-pubsub
source venv/bin/activate
python publisher.py
python subscriber.py ticker-sub
python subscriber.py ticker-sub-2
python subscriber.py ticker-sub-ordered
deactivate