return new Connectable() {
@Override
public void connect(PingClientHandler clientHandler) {
Hold c = clients.get(address);
if (c == null) {
PingClient pingClient = new PingClient();
if (!Double.isNaN(minTimeToRepeat)) {
pingClient.withMinTimeToRepeat(minTimeToRepeat);
}
if (!Double.isNaN(repeatTime)) {
pingClient.withRepeatTime(repeatTime);
}
if (!Double.isNaN(timeoutFromBeginning)) {
pingClient.withTimeoutFromBeginning(timeoutFromBeginning);
}
if (readyFactory != null) {
pingClient.override(readyFactory);
}
c = new Hold(pingClient.withAddress(address).withQueue(queue, repeatExecutor));
final Hold cc = c;
clients.put(address, cc);
c.handlers.add(clientHandler);