in tchannel-crossdock/src/main/java/com/uber/tchannel/crossdock/behavior/trace/ThriftHandler.java [49:73]
Response callDownstream(Downstream downstream, InetAddress host, int port) throws Exception {
ThriftRequest<Call_args> request = new ThriftRequest
.Builder<Call_args>(downstream.getServiceName(), ENDPOINT)
.setTimeout(1, TimeUnit.MINUTES)
.setBody(new Call_args(objectToData(downstream)))
.build();
SubChannel subChannel = behavior.tchannel.makeSubChannel(downstream.getServiceName());
TFuture<ThriftResponse<Call_result>> responsePromise = subChannel.send(
request,
host,
port
);
ThriftResponse<Call_result> thriftResponse = responsePromise.get();
try {
if (thriftResponse.isError()) {
throw new Exception("Error response: " + thriftResponse.getError());
}
Data data = thriftResponse.getBody(Call_result.class).getSuccess();
return dataToObject(data, Response.class);
} finally {
thriftResponse.release();
}
}