There are also constructors to NettyTransceiver that take timeout values
for connections (this happens to be from 1.6.3):
/**
* Creates a NettyTransceiver, and attempts to connect to the given
address.
* {@link #DEFAULT_CONNECTION_TIMEOUT_MILLIS} is used for the connection
* timeout.
* @param addr the address to connect to.
* @throws IOException if an error occurs connecting to the given address.
*/
public NettyTransceiver(InetSocketAddress addr) throws IOException {
this(addr, DEFAULT_CONNECTION_TIMEOUT_MILLIS);
}
/**
* Creates a NettyTransceiver, and attempts to connect to the given
address.
* @param addr the address to connect to.
* @param connectTimeoutMillis maximum amount of time to wait for
connection
* establishment in milliseconds, or null to use
* {@link #DEFAULT_CONNECTION_TIMEOUT_MILLIS}.
* @throws IOException if an error occurs connecting to the given address.
*/
public NettyTransceiver(InetSocketAddress addr,
Long connectTimeoutMillis) throws IOException {
this(addr, new NioClientSocketChannelFactory(
Executors.newCachedThreadPool(new NettyTransceiverThreadFactory(
"Avro " + NettyTransceiver.class.getSimpleName() + " Boss")),
Executors.newCachedThreadPool(new NettyTransceiverThreadFactory(
"Avro " + NettyTransceiver.class.getSimpleName() + " I/O
Worker"))),
connectTimeoutMillis);
}
On Thu, Jul 19, 2012 at 12:23 PM, Doug Cutting <[email protected]> wrote:
> On Thu, Jul 19, 2012 at 11:41 AM, Christophe Taton <[email protected]>
> wrote:
> > Is there an equivalent with NettyTransceivers?
>
> You might use the Callback API and use a CallFuture#await()?
>
> Doug
>