This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: introduce type for raw byte responses (API)
ClosedPublic

Authored by indygreg on Feb 7 2018, 7:27 PM.

Details

Summary

Right now we simply return a str/bytes instance for simple
responses. I want all wire protocol response types to be strongly
typed. So let's invent and use a type for raw bytes responses.

.. api::

Wire protocol command handlers now return a
wireprototypes.bytesresponse instead of a raw bytes instance.
Protocol handlers will continue handling bytes instances. However,
any extensions wrapping wire protocol commands will need to handle
the new type.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Feb 7 2018, 7:27 PM
indygreg updated this revision to Diff 5325.Feb 7 2018, 7:31 PM
indygreg edited the summary of this revision. (Show Details)Feb 7 2018, 11:32 PM
indygreg updated this revision to Diff 5341.
durin42 accepted this revision.Feb 12 2018, 4:25 PM
This revision is now accepted and ready to land.Feb 12 2018, 4:25 PM
This revision was automatically updated to reflect the committed changes.