Skip to content

Commit

Permalink
integrations vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Jan 10, 2024
1 parent 7594256 commit b08bda4
Show file tree
Hide file tree
Showing 12 changed files with 826 additions and 824 deletions.
8 changes: 4 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ cl <- make_cluster(4)
cl
```

A 'miraiCluster' is fully compatible with all 'parallel' functions such as `parallel::clusterApply()` [[further details](https://shikokuchuo.net/mirai/articles/mirai.html#parallel-clusters)].
A 'miraiCluster' is fully compatible with all 'parallel' functions such as `parallel::clusterApply()` [[further details](https://shikokuchuo.net/mirai/articles/parallel.html)].

### Asynchronous Shiny and Plumber Applications

{mirai} serves as an asynchronous backend for scaling enterprise {shiny} or {plumber} applications.

A 'mirai' plugs in directly to Shiny's reactive framework without the need to use promises [[see example](https://shikokuchuo.net/mirai/articles/mirai.html#shiny-example-usage)].
A 'mirai' plugs in directly to Shiny's reactive framework without the need to use promises [[see example](https://shikokuchuo.net/mirai/articles/shiny.html#shiny-example-usage)].

Alternatively, 'mirai' may be used interchangeably with 'promises' by using the promise pipe `%...>%`, or explictly by `promises::as.promise()`, allowing side-effects to be performed upon asynchronous resolution of a 'mirai'.

Expand All @@ -154,7 +154,7 @@ p <- mirai({Sys.sleep(1); "hello"}) %...>% cat()
p
```

Example usage is provided for [shiny](https://shikokuchuo.net/mirai/articles/mirai.html#async-shiny-applications) and for [plumber](https://shikokuchuo.net/mirai/articles/mirai.html#promises-async-plumber-applications).
Example usage is provided for [shiny](https://shikokuchuo.net/mirai/articles/shiny.html) and for [plumber](https://shikokuchuo.net/mirai/articles/plumber.html).

### Torch Parallelization

Expand All @@ -166,7 +166,7 @@ In the case of {torch}, this requires just the following call at the head of you
serialization(refhook = list(torch::torch_serialize, torch::torch_load))
```

This allows tensors, including complex objects such as models, optimizers etc. to be used seamlessly across local and remote processes in the same way as other R objects [[further details](https://shikokuchuo.net/mirai/articles/mirai.html#custom-serialization-torch-parallelization)].
This allows tensors, including complex objects such as models, optimizers etc. to be used seamlessly across local and remote processes in the same way as other R objects [[further details](https://shikokuchuo.net/mirai/articles/torch.html)].

### Thanks

Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ result.

``` r
m$data
#> [1] -0.5332582 -0.1946295 0.1806072 -2.5935705 -0.5650986 -1.7696028
#> [7] -0.3855689 5.5368785 -5.1379670 -1.8752643
#> [1] -1.43344968 -0.02044095 -0.54523216 3.66578804 5.10911257
#> [6] 0.19572871 0.27279264 -1.83408111 -48.92140310 -0.69761779
```

Alternatively, explicitly call and wait for the result using
`call_mirai()`.

``` r
call_mirai(m)$data
#> [1] -0.5332582 -0.1946295 0.1806072 -2.5935705 -0.5650986 -1.7696028
#> [7] -0.3855689 5.5368785 -5.1379670 -1.8752643
#> [1] -1.43344968 -0.02044095 -0.54523216 3.66578804 5.10911257
#> [6] 0.19572871 0.27279264 -1.83408111 -48.92140310 -0.69761779
```

### Daemons
Expand Down Expand Up @@ -162,7 +162,7 @@ cl

A ‘miraiCluster’ is fully compatible with all ‘parallel’ functions such
as `parallel::clusterApply()` \[[further
details](https://shikokuchuo.net/mirai/articles/mirai.html#parallel-clusters)\].
details](https://shikokuchuo.net/mirai/articles/parallel.html)\].

### Asynchronous Shiny and Plumber Applications

Expand All @@ -171,7 +171,7 @@ or {plumber} applications.

A ‘mirai’ plugs in directly to Shiny’s reactive framework without the
need to use promises \[[see
example](https://shikokuchuo.net/mirai/articles/mirai.html#shiny-example-usage)\].
example](https://shikokuchuo.net/mirai/articles/shiny.html#shiny-example-usage)\].

Alternatively, ‘mirai’ may be used interchangeably with ‘promises’ by
using the promise pipe `%...>%`, or explictly by
Expand All @@ -189,9 +189,8 @@ p
```

Example usage is provided for
[shiny](https://shikokuchuo.net/mirai/articles/mirai.html#async-shiny-applications)
and for
[plumber](https://shikokuchuo.net/mirai/articles/mirai.html#promises-async-plumber-applications).
[shiny](https://shikokuchuo.net/mirai/articles/shiny.html) and for
[plumber](https://shikokuchuo.net/mirai/articles/plumber.html).

### Torch Parallelization

Expand All @@ -208,7 +207,7 @@ serialization(refhook = list(torch::torch_serialize, torch::torch_load))
This allows tensors, including complex objects such as models,
optimizers etc. to be used seamlessly across local and remote processes
in the same way as other R objects \[[further
details](https://shikokuchuo.net/mirai/articles/mirai.html#custom-serialization-torch-parallelization)\].
details](https://shikokuchuo.net/mirai/articles/torch.html)\].

### Thanks

Expand Down
Loading

0 comments on commit b08bda4

Please sign in to comment.