use of zipkin.reporter.internal.AwaitableCallback in project jaeger-client-java by jaegertracing.
the class ZipkinSender method flush.
@Override
public int flush() throws SenderException {
if (spanBuffer.isEmpty()) {
return 0;
}
AwaitableCallback captor = new AwaitableCallback();
int n = spanBuffer.size();
try {
delegate.sendSpans(spanBuffer, captor);
captor.await();
} catch (RuntimeException e) {
throw new SenderException("Failed to flush spans.", e, n);
} finally {
spanBuffer.clear();
}
return n;
}
Aggregations