Open
Description
followup on #161 (comment)
Is your feature request related to a problem? Please describe.
Use of OT should not result in side effects to user application by installing event listeners which change behavior.
Describe the solution you'd like
Installed listeners should take care to restore/execute the default behavior, e.g. in case of error
listeners rethrowing the Error
in case there are no other listeners.
Describe alternatives you've considered
Don't install listeners instead find other ways to gather this data, e.g. by wrapping emit()
. But not sure if this is working in all cases and it may have a performance impact as emit
is quite a hot function.
Additional context
Side effects I'm aware of (list is for sure not complete):
- installing an
error
listener may eat up exceptions if user has not installed it's own listener - installing a
response
listener on ahttp,ClientRequest
requires the listener to consume the data - installing signal handlers on
process
disables the default behavior (e.g. end process in case of SIGTERM)