开发者

curl multiget in Java

开发者 https://www.devze.com 2023-01-14 14:50 出处:网络
We are using URLConnection in java for for sending and receiving responses to a webservice. For a particular use case we need to be able to send concurrent non-blocking requests to the same web-servic

We are using URLConnection in java for for sending and receiving responses to a webservice. For a particular use case we need to be able to send concurrent non-blocking requests to the same web-service. I like the curl multi-get way of doing this, since it uses the OS (standard POSIX features) to do this.

The ideas was to start with something like this.

http://curl.haxx.se/libcurl/c/m开发者_如何学JAVAulti-post.html

Is there a way to do this in Java? I know that we can use a ThreadPoolExecutor/Threads etc.. but I prefer a curl multi-get like solution.


There is no way to do this in Java.

Mainly because Java is system independent and therefore cannot assume to have a POSIX compatible OS at hand.

Threads are the best way to implement this in Java.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号