Skip to content

Avoid side effects by installing event listeners #225

Open
@Flarna

Description

@Flarna

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 a http,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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestup-for-grabsGood for taking. Extra help will be provided by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions