Skip to content

Commit

Permalink
update plumber vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Oct 8, 2024
1 parent 86baab9 commit 04508dc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions vignettes/plumber.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,28 @@ res <- lapply(
)
collect_aio(res)
#> [[1]]
#> [1] "{\"time\":[\"2024-09-17 14:17:07\"],\"msg\":[\"1\"],\"pid\":[162248]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:25\"],\"msg\":[\"1\"],\"pid\":[81109]}"
#>
#> [[2]]
#> [1] "{\"time\":[\"2024-09-17 14:17:07\"],\"msg\":[\"2\"],\"pid\":[162253]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:25\"],\"msg\":[\"2\"],\"pid\":[81111]}"
#>
#> [[3]]
#> [1] "{\"time\":[\"2024-09-17 14:17:07\"],\"msg\":[\"3\"],\"pid\":[162250]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:25\"],\"msg\":[\"3\"],\"pid\":[81107]}"
#>
#> [[4]]
#> [1] "{\"time\":[\"2024-09-17 14:17:07\"],\"msg\":[\"4\"],\"pid\":[162256]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:25\"],\"msg\":[\"4\"],\"pid\":[81115]}"
#>
#> [[5]]
#> [1] "{\"time\":[\"2024-09-17 14:17:08\"],\"msg\":[\"5\"],\"pid\":[162253]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:26\"],\"msg\":[\"5\"],\"pid\":[81111]}"
#>
#> [[6]]
#> [1] "{\"time\":[\"2024-09-17 14:17:08\"],\"msg\":[\"6\"],\"pid\":[162248]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:26\"],\"msg\":[\"6\"],\"pid\":[81115]}"
#>
#> [[7]]
#> [1] "{\"time\":[\"2024-09-17 14:17:08\"],\"msg\":[\"7\"],\"pid\":[162250]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:26\"],\"msg\":[\"7\"],\"pid\":[81109]}"
#>
#> [[8]]
#> [1] "{\"time\":[\"2024-09-17 14:17:08\"],\"msg\":[\"8\"],\"pid\":[162256]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:26\"],\"msg\":[\"8\"],\"pid\":[81107]}"

daemons(0)
#> [1] 0
Expand All @@ -121,7 +121,7 @@ m <- mirai({
library(mirai)

# uses dispatcher - suitable when requests take differing times to complete
daemons(4L, dispatcher = TRUE) # handles 4 requests simultaneously
daemons(4L, dispatcher = "thread") # handles 4 requests simultaneously

pr() |>
pr_post(
Expand Down Expand Up @@ -164,28 +164,28 @@ res <- lapply(
)
collect_aio(res)
#> [[1]]
#> [1] "{\"time\":[\"2024-09-17 14:17:11\"],\"msg\":[\"1\"],\"pid\":[162517]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:29\"],\"msg\":[\"1\"],\"pid\":[81336]}"
#>
#> [[2]]
#> [1] "{\"time\":[\"2024-09-17 14:17:11\"],\"msg\":[\"2\"],\"pid\":[162519]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:29\"],\"msg\":[\"2\"],\"pid\":[81338]}"
#>
#> [[3]]
#> [1] "{\"time\":[\"2024-09-17 14:17:11\"],\"msg\":[\"3\"],\"pid\":[162522]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:29\"],\"msg\":[\"3\"],\"pid\":[81344]}"
#>
#> [[4]]
#> [1] "{\"time\":[\"2024-09-17 14:17:12\"],\"msg\":[\"4\"],\"pid\":[162525]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:30\"],\"msg\":[\"4\"],\"pid\":[81338]}"
#>
#> [[5]]
#> [1] "{\"time\":[\"2024-09-17 14:17:11\"],\"msg\":[\"5\"],\"pid\":[162525]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:30\"],\"msg\":[\"5\"],\"pid\":[81336]}"
#>
#> [[6]]
#> [1] "{\"time\":[\"2024-09-17 14:17:12\"],\"msg\":[\"6\"],\"pid\":[162517]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:29\"],\"msg\":[\"6\"],\"pid\":[81340]}"
#>
#> [[7]]
#> [1] "{\"time\":[\"2024-09-17 14:17:12\"],\"msg\":[\"7\"],\"pid\":[162522]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:30\"],\"msg\":[\"7\"],\"pid\":[81340]}"
#>
#> [[8]]
#> [1] "{\"time\":[\"2024-09-17 14:17:12\"],\"msg\":[\"8\"],\"pid\":[162519]}"
#> [1] "{\"time\":[\"2024-10-08 12:21:30\"],\"msg\":[\"8\"],\"pid\":[81344]}"

daemons(0)
#> [1] 0
Expand Down
2 changes: 1 addition & 1 deletion vignettes/plumber.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ m <- mirai({
library(mirai)

# uses dispatcher - suitable when requests take differing times to complete
daemons(4L, dispatcher = TRUE) # handles 4 requests simultaneously
daemons(4L, dispatcher = "thread") # handles 4 requests simultaneously

pr() |>
pr_post(
Expand Down

0 comments on commit 04508dc

Please sign in to comment.