Interface ControlEventHandler

All Known Implementing Classes:
DcpChannelControlHandler, EventHandlerAdapter, StreamEventBuffer

public interface ControlEventHandler
This interface acts as a callback on the Client.controlEventHandler(ControlEventHandler) API that allows one to react to control events.

Right now the only event emitted is a RollbackMessage which should be handled appropriately since it indicates that very likely the current consumer state is ahead of the server. This happens during failover scenarios and/or if something weird happened to the persisted session state.

Keep in mind that the callback is called on the IO event loops, so you should never block or run expensive computations in the callback! Use queues and other synchronization primitives!

Since:
1.0.0
Author:
Michael Nitschinger
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onEvent(ChannelFlowController flowController, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf event)
    Called every time when a control event happens that should be handled by consumers of the Client.
  • Method Details

    • onEvent

      void onEvent(ChannelFlowController flowController, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf event)
      Called every time when a control event happens that should be handled by consumers of the Client.

      Even if you are not doing anything with the events, make sure to release the buffer!!

      Parameters:
      flowController - the flow controller for the passed event.
      event - the control event happening.