Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Listener handling overrideable #320

Merged
merged 7 commits into from
Oct 23, 2018
Merged

make Listener handling overrideable #320

merged 7 commits into from
Oct 23, 2018

Conversation

Dieterbe
Copy link
Contributor

No description provided.

Dieterbe and others added 7 commits October 23, 2018 15:02
Give it access to the net.Conn when we have one.
This enables it to inspect it for logging and instrumentation,
opening the door for 3rd party projects that want to use our code
but have their own logging and metrics approach.

We still get to enjoy the code reuse optimization of having the same
io.Reader-based code path for handling both conns and packets,
but it is now an implementation detail rather than enforcing it via
the Handler function signature.

While we're at it, make logging around connections more consistent
and better.
* let Handlers just focus on deserialization stuff, not networking,
  logging, etc.
* by moving the latter into an overreable function in the Listener,
  we can get rid of duplication between Plain and Pickle, while
  still allowing 3rd parties to override what they need.
makes the construction of the listener less redundant
make Listener handling logic customizable
@Dieterbe Dieterbe merged commit 9a65912 into master Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant