Search in sources :

Example 1 with AwaitableCallback

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;
}
Also used : AwaitableCallback(zipkin.reporter.internal.AwaitableCallback) SenderException(com.uber.jaeger.exceptions.SenderException) Endpoint(com.twitter.zipkin.thriftjava.Endpoint)

Aggregations

Endpoint (com.twitter.zipkin.thriftjava.Endpoint)1 SenderException (com.uber.jaeger.exceptions.SenderException)1 AwaitableCallback (zipkin.reporter.internal.AwaitableCallback)1