function waterfallCallback(error, ...result) {
  this.instance.running--;

  if (!this.instance.buffer.isEmpty()) {
    setImmediate(this.instance._boundRunNext);
  }

  if (error) {
    const cbError =
      error instanceof KuzzleError
        ? error
        : kerror.getFrom(error, "unexpected_error", error.message);

    this.callback.call(this.callbackContext, cbError);
  } else {
    this.callback.call(this.callbackContext, null, ...result);
  }
}
We declare the callback used by waterfall one time instead
of redeclaring a closure each time we want to run the pipes.

This callback must be called with the following object as context:
{ instance: (pipeRunner instance), callback: (callback after pipes execution) }