R version 4.4.0 beta (2024-04-12 r86412 ucrt) -- "Puppy Cup" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(nanonext) > requireNamespace("mirai", quietly = TRUE) > library(promises) > library(mirai.promises) Registered S3 method overwritten by 'mirai.promises': method from as.promise.mirai mirai > nanotest <- function(x) invisible(x || stop("is not TRUE when expected to be TRUE")) > > s <- socket() > r <- recv_aio(s) > nanotest(is.promise(as.promise(r))) > nanotest(is.promising(r)) > close(s) > if (requireNamespace("mirai", quietly = TRUE)) { + nanotest(is.promise(p1 <- as.promise(mirai::mirai("completed")))) + nanotest(is.promise(p2 <- mirai::mirai("completed") %...>% identity())) + Sys.sleep(3L) + } > nanotest(mirai.promises:::.[["pollfreq"]] == 0.1) > nanotest(is.null(polling(freq = 1000))) > nanotest(mirai.promises:::.[["pollfreq"]] == 1L) > nanotest(is.null(polling())) > nanotest(mirai.promises:::.[["pollfreq"]] == 0.1) > > proc.time() user system elapsed 0.29 0.09 3.48