Code example for ArrayList

Methods: add

0
 * A compilation test for using MultiReader in Java. 
 */ 
public class MultiReaderUsage { 
  public ReadHandle make() { 
    SocketAddress localhost = new InetSocketAddress("localhost", 22133);
    ArrayList<SocketAddress> clusterMembers = new ArrayList<SocketAddress>();
    clusterMembers.add(localhost);
    StaticCluster<SocketAddress> cluster =
      new StaticCluster<SocketAddress>(null);
 
    return 
      MultiReader.newBuilder(cluster, "the-queue")
        .clientBuilder( 
          ClientBuilder.get() 
            .codec(new Kestrel()) 
            .hostConnectionLimit(1) 
            .requestTimeout(Duration.fromTimeUnit(30, TimeUnit.SECONDS)))
        .build(); 
  } 
}