You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thinking through our eventEmitter garbage. We have at least 3 distinct eventEmitters inside of portalnetwork and we should really consider either putting these all on a central event bus or at least making them all StrictEventEmitters. They are:
portalnetwork class - this is a StrictEventEmitter with typed events (including an unused ContentAdded event
protocol base class - each subprotocol is a bare eventEmitter that currently only emits a ContentAdded event (used widely for gossip and resolving sendFindContent calls among other things
uTP looks like it has multiple event emitters inside it. I'm less concerned about these as they are contained within uTP which the rest of the portal network class should treat as a black box (not entirely successfully but still, it's a worthy goal)
So, at a minimum, let's do the following:
Remove the ContentAdded event from the IPortalNetworkEvents interface
Switch the protocol classes's EventEmitter to the StrictEventEmitter type and create an interface for the ContentAdded event
Make the uTP event emitters StrictEventEmitter with typed events.
The text was updated successfully, but these errors were encountered:
Thinking through our
eventEmitter
garbage. We have at least 3 distincteventEmitters
inside ofportalnetwork
and we should really consider either putting these all on a central event bus or at least making them allStrictEventEmitters
. They are:portalnetwork
class - this is aStrictEventEmitter
with typed events (including an unusedContentAdded
eventprotocol
base class - each subprotocol is a bareeventEmitter
that currently only emits aContentAdded
event (used widely for gossip and resolvingsendFindContent
calls among other thingsSo, at a minimum, let's do the following:
ContentAdded
event from theIPortalNetworkEvents
interfaceprotocol
classes's EventEmitter to theStrictEventEmitter
type and create an interface for theContentAdded
eventStrictEventEmitter
with typed events.The text was updated successfully, but these errors were encountered: