use of com.linkedin.r2.transport.common.bridge.server.TransportCallbackAdapter in project rest.li by linkedin.
the class MockClient method streamRequest.
@Override
public void streamRequest(StreamRequest request, RequestContext requestContext, Callback<StreamResponse> callback) {
TransportCallback<StreamResponse> adapter = HttpBridge.streamToHttpCallback(new TransportCallbackAdapter<StreamResponse>(callback), request);
RestResponse response = new RestResponseBuilder().setStatus(status()).setHeaders(headers()).setEntity(body()).build();
adapter.onResponse(TransportResponseImpl.success(Messages.toStreamResponse(response)));
}
Aggregations