client.py 326 B

123456789101112131415
  1. #!/usr/bin/env python3
  2. import asfpy.pubsub
  3. def process(payload):
  4. keys = list(payload.keys())
  5. if keys == ['stillalive']:
  6. print("Got a ping-back from pubsub")
  7. else:
  8. print("Got a payload!")
  9. print(payload)
  10. pps = asfpy.pubsub.Listener('http://localhost:2069/')
  11. pps.attach(process, raw=True)