A python implementation of TeleHash.
Part of a class project viewable here.
Releasing too early as an ongoing bad habit has brought this project to you today rather than never. By Michael Victor Zink.
Ordered roughly by priority
_ring
/_line
mechanics- Correct k-bucket mechanics
- Not filling up, checking that they exist, etc.
- Correct external tap management (depends on
_ring
/_line
) - An easy way to build a test network
- A better example app
Open to change without warning, I guess. Also, not quite fully implemented.
- Telex
- Really just a dictionary with convenience construction and JSON import/export
- Handler
- A callable object implementing two methods:
matches
, to determine if a given Telex should be processed by this Handler given the sender and current Switch statehandle
, to actually handle the Telex and interact appropriately with the Switch (including sending new Telexes)
- Calling the object will run
handle
if itmatches
- A callable object implementing two methods:
- Switch
- Implements a Twisted UDP protocol
- Gobbles JSON from the network, turning it into a Telex
- Runs the Telex by every Handler currently attached to the Switch
- Provides a send function which automatically manages traffic and ring/line stuff