Learn R Programming

nanonext (version 1.3.0)

is_aio: Validators

Description

Validator functions for object types created by {nanonext}.

Usage

is_aio(x)

is_nano(x)

is_ncurl_session(x)

Value

Logical value TRUE or FALSE.

Arguments

x

an object.

Details

Is the object an Aio (inheriting from class ‘sendAio’ or ‘recvAio’).

Is the object an object inheriting from class ‘nano’ i.e. a nanoSocket, nanoContext, nanoStream, nanoListener, nanoDialer, nanoPipe or nano Object.

Is the object an ncurlSession (object of class ‘ncurlSession’).

Examples

Run this code
nc <- call_aio(ncurl_aio("https://postman-echo.com/get", timeout = 1000L))
is_aio(nc)

s <- socket()
is_nano(s)
n <- nano()
is_nano(n)
close(s)
n$close()

s <- ncurl_session("https://postman-echo.com/get")
is_ncurl_session(s)
if (is_ncurl_session(s)) close(s)

Run the code above in your browser using DataLab