This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: define and implement responses in framing protocol
ClosedPublic

Authored by indygreg on Mar 14 2018, 12:01 PM.

Details

Summary

Previously, we only had client-side frame types defined. This commit
defines and implements basic support for server-side frame types.

We introduce two frame types - one for representing the raw bytes
result of a command and another for representing error results.
The types are quite primitive and behavior will expand over time.
But you have to start somewhere.

Our server reactor gains methods to react to an intent to send a
response. Again, following the "sans I/O" pattern, the reactor
doesn't actually send the data. Instead, it gives the caller a
generator to frames that it can send out over the wire.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Mar 14 2018, 12:01 PM
indygreg updated this revision to Diff 7051.Mar 14 2018, 9:10 PM
indygreg updated this revision to Diff 7143.Mar 19 2018, 7:59 PM
durin42 added inline comments.
mercurial/wireprotoframing.py
347–349

I wonder if we'd be better off with an enumerated set of types that are attr.s instances instead of a dict, but let's not worry about it for now...

durin42 accepted this revision.Mar 21 2018, 9:32 PM
This revision is now accepted and ready to land.Mar 21 2018, 9:32 PM
This revision was automatically updated to reflect the committed changes.