Skip to content

Commit 45216d6

Browse files
committed
jhttp: Document the limitations of push over a Bridge.
1 parent c986bef commit 45216d6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jhttp/bridge.go

+7
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ func (b Bridge) Close() error { return b.local.Close() }
141141

142142
// NewBridge constructs a new Bridge that starts a server on mux and dispatches
143143
// HTTP requests to it. The server will run until the bridge is closed.
144+
//
145+
// Note that a bridge is not able to push calls or notifications from the
146+
// server back to the remote client. The bridge client is shared by multiple
147+
// active HTTP requests, and has no way to know which of the callers the push
148+
// should be forwarded to. You can enable push on the bridge server and set
149+
// hooks on the bridge client as usual, but the remote client will not see push
150+
// messages from the server.
144151
func NewBridge(mux jrpc2.Assigner, opts *BridgeOptions) Bridge {
145152
return Bridge{
146153
local: server.NewLocal(mux, &server.LocalOptions{

0 commit comments

Comments
 (0)