-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jhttp: Re-work the Bridge interface to require less plumbing. (#52)
The purpose of a jhttp.Bridge is to convey requests from an HTTP handler into a JSON-RPC server. The way I had implemented it, however, required interposing a client, which complicated the logic of forwarding. Instead of requiring a client, the Bridge now takes an unstarted server, and starts it up on an in-memory channel. We still have to parse the requests to detect whether there are any calls, since HTTP requires a response regardless of whether the JSON-RPC server replies, but we no longer need to virtualize request IDs or re-marshal the request values. In addition, add a BridgeOptions type. This is used minimally for now, to allow the caller to override the content-type check, but I wanted to make space for options while I'm breaking things anyway. These are breaking changes to the Bridge API.
- Loading branch information
1 parent
bce1c41
commit 94d2968
Showing
4 changed files
with
128 additions
and
119 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
Oops, something went wrong.