Channels and keys and loops, oh my

Worked on qnet yesterday.  Got the stateless (ordered, not guaranteed) channel working.  Basically this channel allows you to send messages with "keys" (think of them as sub-channels) where each key is considered to be a stateless update.  That is, each message with a given key is a complete update as to the current state of that channel/key combination, so if you receive a newer message you can discard the earlier messages.

Also got a quick sketch of a blocking background-thread mainloop that could be used with Pygame and a Pygame-specific message-sender class.  Still needs work (it's using magic pauses in a few spots for cleanup).  Improved the speed of the whole system considerably (particularly for the non-blocking mainloop), mostly by reducing the use of logging and fixing a few non-linear algos.  Made it possible for different channels to use different protocols with different message formats (e.g. the stateless channel uses a different message format than the reliable channel).

At the moment all of the channel setup is done via direct calls. I'm intending that the application level make the decisions about when to open new channels and the like, but at the moment incoming messages on unknown channels are defaulting to creating a reliable channel.  Want to clean up the network-structure management interface as well (have that started).  Also want to do per-host throttling; at the moment there's per-channel throttling (max-in-flight style), but if someone had dozens of channels to a single host they would then be sending dozens*max-in-flight.

Anyway, still proving to be a fun little project.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.