Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.19 KB

kafka-common-network-Selectable.adoc

File metadata and controls

47 lines (35 loc) · 1.19 KB

Selectable

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

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