Class: EventHubManager

fabric-network~ EventHubManager

The Event Hub Manager is responsible for creating and distributing event hubs. It uses the event hub factory to reuse event hubs that exists, and maintains its own list of new event hubs that are used for event replay

new EventHubManager(network)

Constructor
Parameters:
Name Type Description
network module:fabric-network.Network The network

Methods


dispose()

Disconnect from and delete all event hubs

getEventHub(peer, filtered)

Gets an event hub. If given a peer, it will get that peers event hub, otherwise it will get the next peer defined by the EventHubSelectionStrategy
Parameters:
Name Type Description
peer Peer A peer instance
filtered boolean Flag to decide between filtered and unfiltered events
Returns:
The event hub
Type
ChannelEventHub

getEventHubs(peers)

Gets a list of event hubs from the EventHubFactory for a list of peers
Parameters:
Name Type Description
peers Array.<Peer> A list of peer instances

getFixedEventHub(peer)

Will get a new event hub instance without the possibility of selecting a new peer
Parameters:
Name Type Description
peer Peer A peer instance
Returns:
The event hub
Type
ChannelEventHub

getReplayEventHub(peer)

Gets a new event hub instance for a give peer and updates the list of new event hubs that have been created
Parameters:
Name Type Description
peer Peer A peer instance
Returns:
The event hub
Type
ChannelEventHub

updateEventHubAvailability(deadPeer)

When called with a peer, it updates the EventHubSelectionStrategy with the new status of a peer to allow for intelligent strategies
Parameters:
Name Type Description
deadPeer Peer A peer instance