Skip to content

Wouldn't the source code for "Reset Connection Pool in case of destruction" be a problem? #197

@orchsik

Description

@orchsik

transform.destroy([error])

  • Destroy the stream, and optionally emit an 'error' event. After this call, the transform stream would release any internal resources.
  • Implementors should not override this method, but instead implement readable._destroy().
  • The default implementation of _destroy() for Transform also emit 'close' unless emitClose is set in false.
  • Once destroy() has been called, any further calls will be a no-op and no further errors except from _destroy() may be emitted as 'error'.

[Sources] https://nodejs.org/api/stream.html#transformdestroyerror


"Implementors should not override this method, "

pino-elasticsearch > lib.js

// Resurrect connection pool on destroy
splitter.destroy = () => {
  if (typeof client.connectionPool.resurrect === 'function') {
    client.connectionPool.resurrect({ name: 'elasticsearch-js' })
  }
}

Overriding this method ...
Wouldn't the source code for "Reset Connection Pool in case of destruction" be a problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions