telehash / plinth

Python Library for InterNetworking with TeleHash
MIT License
26 stars 8 forks source link

Uninformative Examples #3

Open setupminimal opened 10 years ago

setupminimal commented 10 years ago

I believe someone should make an example that clearly shows how to make a channel, how to send a message, and how to handle a message. I'm trying to do this, but I don't know if I have the knowledge to.

dvanduzer commented 10 years ago

Thanks for signing up for Github to get involved!

Unfortunately, nobody has the knowledge to do this yet, because I haven't really implemented the user-facing channel interface. The code that's there right now is just a stale stub. The latest major refactor moved a bunch of stuff around to draw cleaner distinctions between internal switch use of channels, and application-defined channels. More here: https://github.com/telehash/telehash.org/blob/master/protocol.md#channel---content-transport

I chose gevent for async because of its similarity to what's coming out of PEP-3156. Here's a relevant sample app using a simple queue: http://sdiehl.github.io/gevent-tutorial/#chat-server

The pattern I started out emulating for channels looks like this: http://sdiehl.github.io/gevent-tutorial/#actors

I'm currently refactoring that again, though. A semi-stable app-defined channel interface is coming up in alpha release 15, after some other mesh network maintenance work currently in progress for alpha 14. See my comments on https://github.com/telehash/telehash.org/issues/20 for more on the mesh testing stuff, if that is of interest.

setupminimal commented 10 years ago

Thank you! I will read these and see where they take me.