METADATA 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Metadata-Version: 2.1
  2. Name: blinker
  3. Version: 1.8.2
  4. Summary: Fast, simple object-to-object and broadcast signaling
  5. Author: Jason Kirtland
  6. Maintainer-email: Pallets Ecosystem <contact@palletsprojects.com>
  7. Requires-Python: >=3.8
  8. Description-Content-Type: text/markdown
  9. Classifier: Development Status :: 5 - Production/Stable
  10. Classifier: License :: OSI Approved :: MIT License
  11. Classifier: Programming Language :: Python
  12. Classifier: Typing :: Typed
  13. Project-URL: Chat, https://discord.gg/pallets
  14. Project-URL: Documentation, https://blinker.readthedocs.io
  15. Project-URL: Source, https://github.com/pallets-eco/blinker/
  16. # Blinker
  17. Blinker provides a fast dispatching system that allows any number of
  18. interested parties to subscribe to events, or "signals".
  19. ## Pallets Community Ecosystem
  20. > [!IMPORTANT]\
  21. > This project is part of the Pallets Community Ecosystem. Pallets is the open
  22. > source organization that maintains Flask; Pallets-Eco enables community
  23. > maintenance of related projects. If you are interested in helping maintain
  24. > this project, please reach out on [the Pallets Discord server][discord].
  25. >
  26. > [discord]: https://discord.gg/pallets
  27. ## Example
  28. Signal receivers can subscribe to specific senders or receive signals
  29. sent by any sender.
  30. ```pycon
  31. >>> from blinker import signal
  32. >>> started = signal('round-started')
  33. >>> def each(round):
  34. ... print(f"Round {round}")
  35. ...
  36. >>> started.connect(each)
  37. >>> def round_two(round):
  38. ... print("This is round two.")
  39. ...
  40. >>> started.connect(round_two, sender=2)
  41. >>> for round in range(1, 4):
  42. ... started.send(round)
  43. ...
  44. Round 1!
  45. Round 2!
  46. This is round two.
  47. Round 3!
  48. ```