Skip to content

Commit

Permalink
Add docstring for WithAppSpecificRPCInspector (libp2p#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault authored Dec 1, 2022
1 parent d3f151c commit 3d2eab3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ func WithSeenMessagesTTL(ttl time.Duration) Option {
}
}

// WithAppSpecificRpcInspector sets a hook that inspect incomings RPCs prior to
// processing them. The inspector is invoked on an accepted RPC just before it
// is handled. If inspector's error is nil, the RPC is handled. Otherwise, it
// is dropped.
func WithAppSpecificRpcInspector(inspector func(peer.ID, *RPC) error) Option {
return func(ps *PubSub) error {
ps.appSpecificRpcInspector = inspector
Expand Down

0 comments on commit 3d2eab3

Please sign in to comment.