class FinishSpan implements BiConsumer<Object, Throwable> {

  static void finish(TracingFilter filter,
    DubboRequest request, @Nullable Result result, @Nullable Throwable error, Span span) {
    if (request instanceof RpcClientRequest) {
      filter.clientHandler.handleReceive(
        new DubboClientResponse((DubboClientRequest) request, result, error), span);
    } else {
      filter.serverHandler.handleSend(
        new DubboServerResponse((DubboServerRequest) request, result, error), span);
    }
  }

    FinishSpan(Span span, Result result);

}