MCPcopy
hub / github.com/dunglas/mercure / Dispatch

Method Dispatch

transport.go:23–23  ·  view source on GitHub ↗

Dispatch dispatches an update to all subscribers. It trusts u to be well-formed. A caller that builds u from untrusted input (e.g. a publisher request) and dispatches it directly instead of through Hub.Publish MUST call u.Validate first and reject the update on error, otherwise a CR, LF, or NUL in

(ctx context.Context, u *Update)

Source from the content-addressed store, hash-verified

21 // subscription events are trusted and skip Validate (they use reserved
22 // topics that Validate rejects by design).
23 Dispatch(ctx context.Context, u *Update) error
24
25 // AddSubscriber adds a new subscriber to the transport.
26 AddSubscriber(ctx context.Context, s *LocalSubscriber) error

Callers 15

TestBoltHistoryEmitsSpanFunction · 0.65
TestBoltTransportHistoryFunction · 0.65
TestBoltTransportClosedFunction · 0.65
TestStopFunction · 0.65
PublishMethod · 0.65
TestSubscribeNotAFlusherFunction · 0.65

Calls

no outgoing calls

Tested by 15

TestBoltHistoryEmitsSpanFunction · 0.52
TestBoltTransportHistoryFunction · 0.52
TestBoltTransportClosedFunction · 0.52
TestStopFunction · 0.52
TestSubscribeNotAFlusherFunction · 0.52
subscribeFunction · 0.52