This PR adds a multiplex flag that, when enabled, will reuse existing connections across multiple topics. In order to support this, the PeerInfo class has been changed to an EventEmitter, which will emit topic events whenever a new topic has been added to the connection.
PeerInfo objects also have an added topics field, which is an Array of the current topics associated with the connection.
This PR adds a
multiplex
flag that, when enabled, will reuse existing connections across multiple topics. In order to support this, thePeerInfo
class has been changed to an EventEmitter, which will emittopic
events whenever a new topic has been added to the connection.PeerInfo
objects also have an addedtopics
field, which is an Array of the current topics associated with the connection.