Created
June 7, 2016 22:34
-
-
Save rubenarslan/5788dd3fcf41b56bb1be2dffeb149490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Manual page | |
library(curl) | |
?multi | |
# Example of 100 requests over 10 connections | |
real = vector("list", 10) | |
for(i in 1:10){ | |
h <- new_handle(url = "https://httpbin.org/get") | |
multi_add(h, complete = function(res){ | |
print(res) | |
real[[i]] = res$status | |
}, error = stop) | |
} | |
results <- multi_run(host_connections = 10) | |
print(real) # gives nulls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment