https://github.com/objarni/buztest
Experiment with pub-sub architecture (goal: refactor pytddmon)
https://github.com/objarni/buztest
Last synced: about 1 year ago
JSON representation
Experiment with pub-sub architecture (goal: refactor pytddmon)
- Host: GitHub
- URL: https://github.com/objarni/buztest
- Owner: objarni
- License: mit
- Created: 2015-02-03T12:13:13.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-08T17:43:21.000Z (over 11 years ago)
- Last Synced: 2025-02-06T11:55:25.863Z (over 1 year ago)
- Language: Python
- Size: 180 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# buztest
Experiment with pub-sub architecture (goal: refactor pytddmon).
The goal is to increase testability and elegance/understandability of pytddmon, NOT higher performance (which is likely to occur anyway but that is a side-effect).
Example of code that implements a simple producer-consumer scenario:
```python
import threading
import buz
# The producer publishes 10 messages of kind 'item', then a 'done' when done.
# Then it stops (thread of execution), by returning from run() function.
# The consumer (subscribes to messages of kind 'item' and
... TODO
# The consumer subscribes to 'item' and 'done' messages.
# Items are printed to console.
# The done message quits the thread.
... TODO
# TODO: write unit tests first...?
producer = Producer()
consumer = Consumer()
producer.start()
consumer.start()
```