notapplicable.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. [begin reconnect_5mb]
  2. # Asyncio NATS client currently does not implement a reconnect buffer
  3. [end reconnect_5mb]
  4. [begin control_2k]
  5. # Asyncio NATS client does not allow custom control lines
  6. [end control_2k]
  7. [begin subscribe_sync]
  8. # Asyncio NATS client currently does not have a sync subscribe API
  9. [end subscribe_sync]
  10. [begin servers_added]
  11. # Asyncio NATS client does not support discovered servers handler right now
  12. [end servers_added]
  13. [begin connection_listener]
  14. # Asyncio NATS client can be defined a number of event callbacks
  15. async def disconnected_cb():
  16. print("Got disconnected!")
  17. async def reconnected_cb():
  18. # See who we are connected to on reconnect.
  19. print("Got reconnected to {url}".format(url=nc.connected_url.netloc))
  20. async def error_cb(e):
  21. print("There was an error: {}".format(e))
  22. async def closed_cb():
  23. print("Connection is closed")
  24. # Setup callbacks to be notified on disconnects and reconnects
  25. options["disconnected_cb"] = disconnected_cb
  26. options["reconnected_cb"] = reconnected_cb
  27. # Setup callbacks to be notified when there is an error
  28. # or connection is closed.
  29. options["error_cb"] = error_cb
  30. options["closed_cb"] = closed_cb
  31. await nc.connect(**options)
  32. [end connection_listener]