Skip to content

diesel 4 Transport Refactor

dowski edited this page Jan 2, 2015 · 1 revision

Overview

diesel 3.x has two official transport implementations - TCP and UDP. The TCP implementation came first. The UDP implementation grew on top of the TCP implementation, which led to some odd subclassing (e.g. UDPSocket inheriting from Connection which was the TCP implementation).

There are also a couple "unofficial" transports that live in the diesel.protocols package. They are ZeroMQ and Nitro. Both are implemented more as Client classes even though they don't subclass diesel.Client. And they each have their own Service-like implementation. The fact is though they aren't application level protocols like the other modules in diesel.protocols - they are more transport oriented and application protocols are built on top of them.

Finally, much of the transport code lives in diesel.core with Service-related code in diesel.app. There are some strange circular dependencies (currently worked around with lazy-imports) that happen due to that structure that can be broken with a different structure.

Goals

  • Don't have UDP classes depend on the TCP classes.
  • Promote ZeroMQ and Nitro to first-class transport status (e.g. they will work in concert with the standard diesel.send/diesel.recieve API).
  • Organize transport related code into a unified subpackage.

Progress

  • Transport code is organized in diesel.transports, circular dependencies broken.
  • UDP and TCP transport do not directly depend on each other.
  • ZeroMQ as first-class transport (90% done).
Clone this wiki locally