How do I create an async caching http client?

后端 未结 1 1374
独厮守ぢ
独厮守ぢ 2021-01-15 23:09

Using the org.apache.httpcomponents:httpasyncclient-cache:4.1.3 library, I\'m trying to work out how I can create an asynchronous caching

1条回答
  •  一整个雨季
    2021-01-15 23:34

    You can create a new CachingHttpAsyncClient directly after you have built a HttpAsyncClient. For example:

    CloseableHttpAsyncClient asyncClient= HttpAsyncClientBuilder.create().build();
    
    CachingHttpAsyncClient client = new CachingHttpAsyncClient(asyncClient, cacheConfig());
    

    You can know more constructors from here.

    0 讨论(0)
提交回复
热议问题