NOTES.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. https://www.rabbitmq.com/getstarted.html
  2. send.py -> receive.py https://www.rabbitmq.com/tutorials/tutorial-one-python.html Hello World.
  3. uses: hello queue
  4. new_task.py -> worker.py, worker2.py https://www.rabbitmq.com/tutorials/tutorial-two-python.html Work Queues.
  5. uses: task_queue
  6. rpc_client.py -> rpc_server.py https://www.rabbitmq.com/tutorials/tutorial-six-python.html RPC Call
  7. uses: rpc_queue
  8. Ok, so save time at the end of the callback, and compare at the start
  9. of the callback. If > 10 seconds, clear our throttle buffer!
  10. ^ Ok, here's the problem: Pacer. We get a message, login, process.
  11. Then what? The problem is, we want to logout after 4-5 seconds of
  12. nothing to do.
  13. https://github.com/pika/pika/issues/770
  14. Replacing:
  15. channel.start_consuming()
  16. with
  17. while channel._consumer_infos:
  18. channel.connection.process_data_events(time_time=1)
  19. print("Ok! I can do something between events / when I have no events.")
  20. See worker2.py for working example of this.
  21. ^ This allows us to do something (like see if we are logged in, and if a certain amount of time
  22. has passed or not. We'll be able to logout / do other things.
  23. I'm not sure about the 1 second. I don't need it to be like that. Maybe 60? (Every minute?) or
  24. if we're waiting for work, set at 10, if we're logged out, set to 60.