-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-mysql: Split Request and Protocol Messages
Problem Finagle models `Service`s as a function from a `Request` to a `Future` of a `Response`. For each particular protocol, this definition of a `Service` is publicly accessible, and for finagle-mysql it follows. However, finagle-mysql's `Request` class is a mixture of both protocol level messages and user run commands. This can make APIs awkward since `Request` is public, but the protocol level messages should not be. Also since `Request` is sealed, all the extensions need to be contained within the `Request` file. Solution Extract a higher trait from `Request` named `ProtocolMessage` which has a sequence number and can be converted to a `Packet`. This allows protocol level messages to extend that, and not `Request`. This then leaves user level commands as `Request`s, and allows us to remove the synthetic `Command.COM_NO_OP` which is intended to work around the fact that protocol level messages are not commands. JIRA Issues: CSL-7990 Differential Revision: https://phabricator.twitter.biz/D327554
- Loading branch information
1 parent
0b2ec20
commit d6e4042
Showing
4 changed files
with
34 additions
and
13 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
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
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
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