| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/ncurl.R |
| 3 |
\name{as.promise.ncurlAio} |
| 4 |
\alias{as.promise.ncurlAio} |
| 5 |
\title{Make ncurlAio Promise} |
| 6 |
\usage{ |
| 7 |
\method{as.promise}{ncurlAio}(x) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{x}{an object of class 'ncurlAio'.} |
| 11 |
} |
| 12 |
\value{ |
| 13 |
A 'promise' object. |
| 14 |
} |
| 15 |
\description{ |
| 16 |
Creates a 'promise' from an 'ncurlAio' object. |
| 17 |
} |
| 18 |
\details{ |
| 19 |
This function is an S3 method for the generic \code{as.promise} for class |
| 20 |
'ncurlAio'. |
| 21 |
|
| 22 |
Requires the \pkg{promises} package. |
| 23 |
|
| 24 |
Allows an 'ncurlAio' to be used with functions such as \code{promises::then()}, |
| 25 |
which schedules a function to run upon resolution of the Aio. |
| 26 |
|
| 27 |
The promise is resolved with a list of 'status', 'headers' and 'data' or |
| 28 |
rejected with the error translation if an NNG error is returned e.g. for an |
| 29 |
invalid address. |
| 30 |
} |