Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.ng.wire

# Interface AsynchronousChannelListener

All Known Implementing Classes:
  `AsynchronousChannelListenerDispatcher`, `WireEventHandle`

public interface AsynchronousChannelListener
Listener interface for events on the asynchronous channel.

Since:
  3.0
Author:
  Mark Rotteveel

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static final record`
  `AsynchronousChannelListener.Event`
  Event count notification

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `channelClosing(FbWireAsynchronousChannel channel)`
  Signals the closing of an asynchronous channel.
  `void`
  `eventReceived(FbWireAsynchronousChannel channel, AsynchronousChannelListener.Event event)`
  Signals that an event has been received.

- ## Method Details

  - ### channelClosing

    void channelClosing(FbWireAsynchronousChannel channel)
    Signals the closing of an asynchronous channel.

    Fired before the channel is actually closed.

    Parameters:
      `channel` - channel that is being closed

  - ### eventReceived

    void eventReceived(FbWireAsynchronousChannel channel, AsynchronousChannelListener.Event event)
    Signals that an event has been received.

    Implementations should take care to only perform short processing on the current thread. If longer or complicated processing is necessary, please offload it to another thread or executor.

    Parameters:
      `channel` - channel that received the event
      `event` - event received