Interface DataEventHandler

All Known Implementing Classes:
StreamEventBuffer

public interface DataEventHandler
This interface acts as a callback on the Client.dataEventHandler(DataEventHandler) API that allows one to react to data events.

Right now DcpMutationMessage, DcpExpirationMessage and DcpDeletionMessage are emitted, but the expirations are as of Couchbase Server 4.5.0 not actually emitted. So while good practice to handle them, even if you opt out to do so make sure to release the buffers.

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 primities!

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 when a data event happens.
  • Method Details

    • onEvent

      void onEvent(ChannelFlowController flowController, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf event)
      Called when a data event happens.

      Make sure to release the buffers!!

      Parameters:
      flowController - the flow controller for the passed event.
      event - the data event happening right now.