Hello Grizzly Users!,
I have a few questions.
1) Is this a legitimate way to build an async client. I want to offload the borrow from the connection pool to another thread.
public void send(final BaseMessage message) {
transport.getWorkerThreadPool().submit(new Runnable() {
@Override
public void run() {
Connection connection = null;
try {
connection = pool.borrow();
connection.write(message);
} catch (Exception e) {
throw new ClientException("Failed to send message.", e);
} finally {
if (connection != null) {
pool.release(connection);
}
}
}
});
}
2) When using SingleEndpointPool in what order should I close/shutdown the pool/transport?
Thanks,
-paul