blob: 4b4b48dd05bef3ea4281a808dab1082f57bf090c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http.client;
import com.ning.http.client.AsyncHttpClient;
import com.yahoo.jdisc.Metric;
import com.yahoo.jdisc.Request;
import com.yahoo.jdisc.handler.ContentChannel;
import com.yahoo.jdisc.handler.ResponseHandler;
import com.yahoo.jdisc.http.HttpRequest;
/**
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a>
*/
final class BufferedRequest {
private BufferedRequest() {
// hide
}
public static ContentChannel executeRequest(AsyncHttpClient ningClient, Request request, HttpRequest.Method method,
ResponseHandler handler, Metric metric, Metric.Context ctx)
{
return new BufferedRequestContent(ningClient, request, method,
new AsyncResponseHandler(request, handler, metric, ctx));
}
}
|