Search in sources :

Example 11 with ControlResponseCode

use of io.aeron.archive.codecs.ControlResponseCode in project aeron by real-logic.

the class ArchiveTests method awaitResponse.

static void awaitResponse(final Subscription controlResponse, final long expectedCorrelationId) {
    final ControlResponseAdapter controlResponseAdapter = new ControlResponseAdapter(new FailControlResponseListener() {

        public void onResponse(final long controlSessionId, final long correlationId, final long relevantId, final ControlResponseCode code, final String errorMessage) {
            if (correlationId != expectedCorrelationId) {
                throw new IllegalStateException("expected=" + expectedCorrelationId + " actual=" + correlationId);
            }
        }
    }, controlResponse, 1);
    Tests.await(() -> controlResponseAdapter.poll() != 0, TIMEOUT_NS);
}
Also used : ControlResponseAdapter(io.aeron.archive.client.ControlResponseAdapter) ControlResponseCode(io.aeron.archive.codecs.ControlResponseCode)

Aggregations

ControlResponseCode (io.aeron.archive.codecs.ControlResponseCode)11 ControlResponseAdapter (io.aeron.archive.client.ControlResponseAdapter)9