Skip to content

Instantly share code, notes, and snippets.

@rubenarslan
Created June 7, 2016 22:34
Show Gist options
  • Save rubenarslan/5788dd3fcf41b56bb1be2dffeb149490 to your computer and use it in GitHub Desktop.
Save rubenarslan/5788dd3fcf41b56bb1be2dffeb149490 to your computer and use it in GitHub Desktop.
# 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