Selectable

Selectable is the contract for asynchronous, multi-channel network I/O.

Note
Selector is the one and only Selectable.
package org.apache.kafka.common.network;

public interface Selectable {
  void connect(String id, InetSocketAddress address, int sendBufferSize, int receiveBufferSize) throws IOException;
  void close();
  void close(String id);

  void send(Send send);
  void poll(long timeout) throws IOException;
  void wakeup();

  List<Send> completedSends();
  List<NetworkReceive> completedReceives();

  Map<String, ChannelState> disconnected();
  List<String> connected();

  void mute(String id);
  void unmute(String id);
  void muteAll();
  void unmuteAll();

  boolean isChannelReady(String id);
}
Table 1. Selectable Contract (in alphabetical order)
Method Description

connect

Used exclusively when NetworkClient is requested to establish a connection to a broker

poll

results matching ""

    No results matching ""