| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/utils.R |
| 3 |
\name{is_aio} |
| 4 |
\alias{is_aio} |
| 5 |
\alias{is_nano} |
| 6 |
\alias{is_ncurl_session} |
| 7 |
\title{Validators} |
| 8 |
\usage{ |
| 9 |
is_aio(x) |
| 10 |
|
| 11 |
is_nano(x) |
| 12 |
|
| 13 |
is_ncurl_session(x) |
| 14 |
} |
| 15 |
\arguments{ |
| 16 |
\item{x}{an object.} |
| 17 |
} |
| 18 |
\value{ |
| 19 |
Logical value TRUE or FALSE. |
| 20 |
} |
| 21 |
\description{ |
| 22 |
Validator functions for object types created by \pkg{nanonext}. |
| 23 |
} |
| 24 |
\details{ |
| 25 |
Is the object an Aio (inheriting from class 'sendAio' or 'recvAio'). |
| 26 |
|
| 27 |
Is the object an object inheriting from class 'nano' i.e. a nanoSocket, |
| 28 |
nanoContext, nanoStream, nanoListener, nanoDialer, nanoMonitor or nano |
| 29 |
Object. |
| 30 |
|
| 31 |
Is the object an ncurlSession (object of class 'ncurlSession'). |
| 32 |
|
| 33 |
Is the object a Condition Variable (object of class 'conditionVariable'). |
| 34 |
} |
| 35 |
\examples{ |
| 36 |
nc <- call_aio(ncurl_aio("https://postman-echo.com/get", timeout = 1000L)) |
| 37 |
is_aio(nc) |
| 38 |
|
| 39 |
s <- socket() |
| 40 |
is_nano(s) |
| 41 |
n <- nano() |
| 42 |
is_nano(n) |
| 43 |
close(s) |
| 44 |
n$close() |
| 45 |
|
| 46 |
s <- ncurl_session("https://postman-echo.com/get", timeout = 1000L) |
| 47 |
is_ncurl_session(s) |
| 48 |
if (is_ncurl_session(s)) close(s) |
| 49 |
|
| 50 |
} |