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);
}
Aggregations