Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the Protocol object into multiple ProtocolParts.
The goal here is to make it possible for different implemenations to implement defined subsets of the Protocol object, but require each subset to match a specific base class so it's clear when you have implemented all the pieces of a specific subset. The code here uses a sort of composition rather than inheritance. Multiple inheritance tends to be rather confusing, so instead we do something similar but slihgtly more explicit; assigning each ProtocolPart to an attibute of the Protocol so that the methods on a part with name foo are available as protocol.foo.method. This involves some changes to the lifecycle methods. In particular setup() is now split into connect() and after_connect() that are expected to be implemented in base classes. Between these being called we call setup() on each ProtocolPart so that we may give them direct access to a connection object or similar.
- Loading branch information
Showing
7 changed files
with
545 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.