This repository has been archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates promises method for better Shiny integration
- Loading branch information
1 parent
86500de
commit 4d09dd7
Showing
10 changed files
with
69 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
library(mirai.promises) | ||
library(nanonext) | ||
requireNamespace("mirai", quietly = TRUE) | ||
library(promises) | ||
library(mirai.promises) | ||
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())) | ||
nanotest(environment(mirai.promises:::as.promise.mirai)[["pollfreq"]] == 0.1) | ||
nanotest(is.null(polling(freq = 1000))) | ||
nanotest(environment(mirai.promises:::as.promise.mirai)[["pollfreq"]] == 1L) | ||
nanotest(is.null(polling())) | ||
nanotest(environment(mirai.promises:::as.promise.mirai)[["pollfreq"]] == 0.1) | ||
Sys.sleep(3L) | ||
} | ||
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) |