class FinishSpan implements BiConsumer<Object, Throwable> {

  static FinishSpan create(TracingFilter filter, DubboRequest request, Result result, Span span) {
    if (request instanceof DubboClientRequest) {
      return new FinishClientSpan(
        span, result, filter.clientHandler, (DubboClientRequest) request);
    }
    return new FinishServerSpan(span, result, filter.serverHandler, (DubboServerRequest) request);
  }

    FinishSpan(Span span, Result result);

}