Running examples in 'crul-Ex.R' failed
The error most likely occurred in:

> ### Name: writing-options
> ### Title: Writing data options
> ### Aliases: writing-options
> 
> ### ** Examples
> 
> # write to disk
> (x <- HttpClient$new(url = "https://httpbin.org"))
<crul connection> 
  url: https://httpbin.org
  curl options: 
  proxies: 
  auth: 
  headers: 
> f <- tempfile()
> res <- x$get("get", disk = f)
> res$content # when using write to disk, content is a path
[1] "D:\\temp\\RtmpCE6JkH\\file18f707c47116"
> readLines(res$content)
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"
> close(file(f))
> 
> # streaming response
> (x <- HttpClient$new(url = "https://httpbin.org"))
<crul connection> 
  url: https://httpbin.org
  curl options: 
  proxies: 
  auth: 
  headers: 
> res <- x$get('stream/50', stream = function(x) cat(rawToChar(x)))
{"status":"503","description":"The deployment is currently unavailable"}
> res$content # when streaming, content is NULL
NULL
> 
> 
> ## Async
> (cc <- Async$new(
+   urls = c(
+     'https://httpbin.org/get?a=5',
+     'https://httpbin.org/get?foo=bar',
+     'https://httpbin.org/get?b=4',
+     'https://httpbin.org/get?stuff=things',
+     'https://httpbin.org/get?b=4&g=7&u=9&z=1'
+   )
+ ))
<crul async connection> 
  urls: 
   https://httpbin.org/get?a=5
   https://httpbin.org/get?foo=bar
   https://httpbin.org/get?b=4
   https://httpbin.org/get?stuff=things
   https://httpbin.org/get?b=4&g=7&u=9&z=1
> files <- replicate(5, tempfile())
> (res <- cc$get(disk = files, verbose = TRUE))
* Found bundle for host httpbin.org: 0xa2d6130 [serially]
* Found bundle for host httpbin.org: 0xa2d6130 [serially]
* Found bundle for host httpbin.org: 0xa2d6130 [serially]
* Found bundle for host httpbin.org: 0xa2d6130 [serially]
*   Trying 130.211.93.80...
* TCP_NODELAY set
* Hostname 'httpbin.org' was found in DNS cache
*   Trying 130.211.93.80...
* TCP_NODELAY set
* Hostname 'httpbin.org' was found in DNS cache
*   Trying 130.211.93.80...
* TCP_NODELAY set
* Hostname 'httpbin.org' was found in DNS cache
*   Trying 130.211.93.80...
* TCP_NODELAY set
* Hostname 'httpbin.org' was found in DNS cache
*   Trying 130.211.93.80...
* TCP_NODELAY set
* Connected to httpbin.org (130.211.93.80) port 443 (#1)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
  CAfile: D:/RCompile/recent/R/etc/curl-ca-bundle.crt
  CApath: none
* Connected to httpbin.org (130.211.93.80) port 443 (#2)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
  CAfile: D:/RCompile/recent/R/etc/curl-ca-bundle.crt
  CApath: none
* Connected to httpbin.org (130.211.93.80) port 443 (#3)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
  CAfile: D:/RCompile/recent/R/etc/curl-ca-bundle.crt
  CApath: none
* Connected to httpbin.org (130.211.93.80) port 443 (#4)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
  CAfile: D:/RCompile/recent/R/etc/curl-ca-bundle.crt
  CApath: none
* Connected to httpbin.org (130.211.93.80) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
  CAfile: D:/RCompile/recent/R/etc/curl-ca-bundle.crt
  CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=*.httpbin.org
*  start date: Jul  4 13:25:02 2018 GMT
*  expire date: Oct  2 13:25:02 2018 GMT
*  subjectAltName: host "httpbin.org" matched cert's "httpbin.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /get?a=5 HTTP/1.1
Host: httpbin.org
User-Agent: R (3.6.0 x86_64-w64-mingw32 x86_64 mingw32)
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*

* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=*.httpbin.org
*  start date: Jul  4 13:25:02 2018 GMT
*  expire date: Oct  2 13:25:02 2018 GMT
*  subjectAltName: host "httpbin.org" matched cert's "httpbin.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /get?foo=bar HTTP/1.1
Host: httpbin.org
User-Agent: R (3.6.0 x86_64-w64-mingw32 x86_64 mingw32)
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*

* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=*.httpbin.org
*  start date: Jul  4 13:25:02 2018 GMT
*  expire date: Oct  2 13:25:02 2018 GMT
*  subjectAltName: host "httpbin.org" matched cert's "httpbin.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /get?b=4 HTTP/1.1
Host: httpbin.org
User-Agent: R (3.6.0 x86_64-w64-mingw32 x86_64 mingw32)
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*

* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=*.httpbin.org
*  start date: Jul  4 13:25:02 2018 GMT
*  expire date: Oct  2 13:25:02 2018 GMT
*  subjectAltName: host "httpbin.org" matche[[1]]
<crul response> 
  url: https://httpbin.org/get?a=5
  request_headers: 
  response_headers: 
    status: HTTP/1.1 503 Service Temporarily Unavailable
    date: Sat, 07 Jul 2018 17:39:46 GMT
    content-type: application/json
    content-length: 73
    connection: keep-alive
    etag: "5b22ab07-49"
    vary: Accept
    x-now-trace: bru1
    server: now
    cache-control: max-age=0
  params: 
    a: 5
  status: 503

[[2]]
<crul response> 
  url: https://httpbin.org/get?foo=bar
  request_headers: 
  response_headers: 
    status: HTTP/1.1 503 Service Temporarily Unavailable
    date: Sat, 07 Jul 2018 17:39:46 GMT
    content-type: application/json
    content-length: 73
    connection: keep-alive
    etag: "5b22ab07-49"
    vary: Accept
    x-now-trace: bru1
    server: now
    cache-control: max-age=0
  params: 
    foo: bar
  status: 503

[[3]]
<crul response> 
  url: https://httpbin.org/get?b=4
  request_headers: 
  response_headers: 
    status: HTTP/1.1 503 Service Temporarily Unavailable
    date: Sat, 07 Jul 2018 17:39:46 GMT
    content-type: application/json
    content-length: 73
    connection: keep-alive
    etag: "5b22ab07-49"
    vary: Accept
    x-now-trace: bru1
    server: now
    cache-control: max-age=0
  params: 
    b: 4
  status: 503

[[4]]
<crul response> 
  url: https://httpbin.org/get?stuff=things
  request_headers: 
  response_headers: 
    status: HTTP/1.1 503 Service Temporarily Unavailable
    date: Sat, 07 Jul 2018 17:39:46 GMT
    content-type: application/json
    content-length: 73
    connection: keep-alive
    etag: "5b22ab07-49"
    vary: Accept
    x-now-trace: bru1
    server: now
    cache-control: max-age=0
  params: 
    stuff: things
  status: 503

[[5]]
<crul response> 
  url: https://httpbin.org/get?b=4&g=7&u=9&z=1
  request_headers: 
  response_headers: 
    status: HTTP/1.1 503 Service Temporarily Unavailable
    date: Sat, 07 Jul 2018 17:39:46 GMT
    content-type: application/json
    content-length: 73
    connection: keep-alive
    etag: "5b22ab07-49"
    vary: Accept
    x-now-trace: bru1
    server: now
    cache-control: max-age=0
  params: 
    b: 4
    g: 7
    u: 9
    z: 1
  status: 503

> lapply(files, readLines)
[[1]]
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"

[[2]]
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"

[[3]]
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"

[[4]]
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"

[[5]]
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"

> 
> ## Async varied
> ### disk
> f <- tempfile()
> g <- tempfile()
> req1 <- HttpRequest$new(url = "https://httpbin.org/get")$get(disk = f)
> req2 <- HttpRequest$new(url = "https://httpbin.org/post")$post(disk = g)
> req3 <- HttpRequest$new(url = "https://httpbin.org/get")$get()
> (out <- AsyncVaried$new(req1, req2, req3))
<crul async varied connection> 
  requests: 
   get: https://httpbin.org/get 
   post: https://httpbin.org/post 
   get: https://httpbin.org/get 
> out$request()
> out$content()
[[1]]
raw(0)

[[2]]
raw(0)

[[3]]
 [1] 7b 22 73 74 61 74 75 73 22 3a 22 35 30 33 22 2c 22 64 65 73 63 72 69 70 74
[26] 69 6f 6e 22 3a 22 54 68 65 20 64 65 70 6c 6f 79 6d 65 6e 74 20 69 73 20 63
[51] 75 72 72 65 6e 74 6c 79 20 75 6e 61 76 61 69 6c 61 62 6c 65 22 7d 0a

> readLines(f)
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"
> readLines(g)
[1] "{\"status\":\"503\",\"description\":\"The deployment is currently unavailable\"}"
> close(file(f))
> close(file(g))
> 
> ### stream - to console
> fun <- function(x) cat(rawToChar(x))
> req1 <- HttpRequest$new(url = "https://httpbin.org/get"
+ )$get(query = list(foo = "bar"), stream = fun)
> req2 <- HttpRequest$new(url = "https://httpbin.org/get"
+ )$get(query = list(hello = "world"), stream = fun)
> (out <- AsyncVaried$new(req1, req2))
<crul async varied connection> 
  requests: 
   get: https://httpbin.org/get 
   get: https://httpbin.org/get 
> out$request()
{"status":"503","description":"The deployment is currently unavailable"}
{"status":"503","description":"The deployment is currently unavailable"}
> out$content()
[[1]]
raw(0)

[[2]]
raw(0)

> 
> ### stream - to an R object
> lst <- c()
> fun <- function(x) lst <<- c(lst, x)
> req1 <- HttpRequest$new(url = "https://httpbin.org/get"
+ )$get(query = list(foo = "bar"), stream = fun)
> req2 <- HttpRequest$new(url = "https://httpbin.org/get"
+ )$get(query = list(hello = "world"), stream = fun)
> (out <- AsyncVaried$new(req1, req2))
<crul async varied connection> 
  requests: 
   get: https://httpbin.org/get 
   get: https://httpbin.org/get 
> out$request()
> lst
  [1] 7b 22 73 74 61 74 75 73 22 3a 22 35 30 33 22 2c 22 64 65 73 63 72 69 70 74
 [26] 69 6f 6e 22 3a 22 54 68 65 20 64 65 70 6c 6f 79 6d 65 6e 74 20 69 73 20 63
 [51] 75 72 72 65 6e 74 6c 79 20 75 6e 61 76 61 69 6c 61 62 6c 65 22 7d 0a 7b 22
 [76] 73 74 61 74 75 73 22 3a 22 35 30 33 22 2c 22 64 65 73 63 72 69 70 74 69 6f
[101] 6e 22 3a 22 54 68 65 20 64 65 70 6c 6f 79 6d 65 6e 74 20 69 73 20 63 75 72
[126] 72 65 6e 74 6c 79 20 75 6e 61 76 61 69 6c 61 62 6c 65 22 7d 0a
> cat(rawToChar(lst))
{"status":"503","description":"The deployment is currently unavailable"}
{"status":"503","description":"The deployment is currently unavailable"}
> 
> 
> 
> ### * <FOOTER>
> ###
> cleanEx()
d cert's "httpbin.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /get?stuff=things HTTP/1.1
Host: httpbin.org
User-Agent: R (3.6.0 x86_64-w64-mingw32 x86_64 mingw32)
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*

* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=*.httpbin.org
*  start date: Jul  4 13:25:02 2018 GMT
*  expire date: Oct  2 13:25:02 2018 GMT
*  subjectAltName: host "httpbin.org" matched cert's "httpbin.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /get?b=4&g=7&u=9&z=1 HTTP/1.1
Host: httpbin.org
User-Agent: R (3.6.0 x86_64-w64-mingw32 x86_64 mingw32)
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*

< HTTP/1.1 503 Service Temporarily Unavailable
< Date: Sat, 07 Jul 2018 17:39:46 GMT
< Content-Type: application/json
< Content-Length: 73
< Connection: keep-alive
< ETag: "5b22ab07-49"
< Vary: Accept
< x-now-trace: bru1
< server: now
< cache-control: max-age=0
< 
* Connection #0 to host httpbin.org left intact
< HTTP/1.1 503 Service Temporarily Unavailable
< Date: Sat, 07 Jul 2018 17:39:46 GMT
< Content-Type: application/json
< Content-Length: 73
< Connection: keep-alive
< ETag: "5b22ab07-49"
< Vary: Accept
< x-now-trace: bru1
< server: now
< cache-control: max-age=0
< 
* Connection #2 to host httpbin.org left intact
< HTTP/1.1 503 Service Temporarily Unavailable
< Date: Sat, 07 Jul 2018 17:39:46 GMT
< Content-Type: application/json
< Content-Length: 73
< Connection: keep-alive
< ETag: "5b22ab07-49"
< Vary: Accept
< x-now-trace: bru1
< server: now
< cache-control: max-age=0
< 
* Connection #1 to host httpbin.org left intact
< HTTP/1.1 503 Service Temporarily Unavailable
< Date: Sat, 07 Jul 2018 17:39:46 GMT
< Content-Type: application/json
< Content-Length: 73
< Connection: keep-alive
< ETag: "5b22ab07-49"
< Vary: Accept
< x-now-trace: bru1
< server: now
< cache-control: max-age=0
< 
* Connection #4 to host httpbin.org left intact
< HTTP/1.1 503 Service Temporarily Unavailable
< Date: Sat, 07 Jul 2018 17:39:46 GMT
< Content-Type: application/json
< Content-Length: 73
< Connection: keep-alive
< ETag: "5b22ab07-49"
< Vary: Accept
< x-now-trace: bru1
< server: now
< cache-control: max-age=0
< 
* Connection cache is full, closing the oldest one.
* Closing connection 1
* Connection #3 to host httpbin.org left intact
Error: connections left open:
	D:\temp\RtmpCE6JkH\file18f702d0d67a (file)
	D:\temp\RtmpCE6JkH\file18f7063ac5061 (file)
	D:\temp\RtmpCE6JkH\file18f70290c2aa8 (file)
	D:\temp\RtmpCE6JkH\file18f7050287203 (file)
	D:\temp\RtmpCE6JkH\file18f701f003a50 (file)
	D:\temp\RtmpCE6JkH\file18f70610a34a5 (file)
	D:\temp\RtmpCE6JkH\file18f705df12a8a (file)
Execution halted