swarm/src/behaviour: Add AndBehaviour
#2719
Labels
difficulty:moderate
getting-started
Issues that can be tackled if you don't know the internals of libp2p very well
help wanted
Description
To combine two
NetworkBehaviour
implementationslibp2p-swarm
should provide a combinator. Contrary toNetworkBehaviour
implementation ofEither
bothNetworkBehaviour
implementations would be running concurrently.Motivation
One use-case is when wanting to either enable two
NetworkBehaviour
s or disable both, but never enable one but disable the other.Toggle<And<BehaviourA, BehaviourB>>
Came up here: n0-computer/iroh#126 (comment)
Requirements
Open questions
And
.Are you planning to do it yourself in a pull request?
No. Though happy to support anyone interested in contributing this.
The text was updated successfully, but these errors were encountered: