diff --git a/articles/mirai.html b/articles/mirai.html index 5e5e17f4..33a43775 100644 --- a/articles/mirai.html +++ b/articles/mirai.html @@ -154,7 +154,7 @@
[]
method:
m[]
-#> [1] 3.495676 3.816495 4.628665 3.491260 5.778629
As a mirai represents an async operation, it is never necessary to
wait for it. Other code can continue to be run. Once it completes, the
return value automatically becomes available at $data
.
m
#> < mirai [$data] >
m$data
-#> [1] 3.495676 3.816495 4.628665 3.491260 5.778629
+#> [1] 5.347230 2.106419 3.248701 3.211770 3.678773
For easy programmatic use of mirai()
, ‘.expr’ accepts a
pre-constructed language object, and also a list of named arguments
passed via ‘.args’. So, the following would be equivalent to the
@@ -174,7 +174,7 @@
The default dispatcher = "process"
creates a
dispatcher()
background process that connects to individual
daemon processes on the local machine. This ensures that tasks are
@@ -341,7 +341,7 @@
This implementation sends tasks immediately, and ensures that tasks are evenly-distributed amongst daemons. This means that optimal scheduling is not guaranteed as the duration of tasks cannot be known @@ -376,11 +376,11 @@
Disconnect from the database everywhere, and set the number of @@ -407,6 +407,10 @@
with()
statement.
+In the case of a Shiny app, all mirai calls will be executed before +the app returns. In the case of other expressions, be sure to call the +results (or collect the values) of all mirai within the expression so +that daemons are not reset before they have all completed.
@@ -518,7 +522,7 @@The number of daemons connecting to the host URL is not limited and network resources may be added or removed at any time, with tasks automatically distributed to all connected daemons.
@@ -627,10 +631,10 @@Note that daemons()
should be set up on the host machine
@@ -667,37 +671,37 @@
launch_remote(1)
#> [1]
-#> Rscript -e 'mirai::daemon("wss://hostname:35957/1",tls=c("-----BEGIN CERTIFICATE-----
+#> Rscript -e 'mirai::daemon("wss://hostname:39839/1",tls=c("-----BEGIN CERTIFICATE-----
#> MIIFNzCCAx+gAwIBAgIBATANBgkqhkiG9w0BAQsFADAzMREwDwYDVQQDDAhrdW1h
#> bW90bzERMA8GA1UECgwITmFub25leHQxCzAJBgNVBAYTAkpQMB4XDTAxMDEwMTAw
#> MDAwMFoXDTMwMTIzMTIzNTk1OVowMzERMA8GA1UE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+2UJndV9uIZZL0H7srjFXkB+fViZQN6z/uIyyqFgOYTGfmtnbfat4y3d2i0HN
+#> ttndC5IJS0Ykil5S/EaUp1Fj03rPe24ACU1ikl2jR3l7eredClv3UlLvCg==
#> -----END CERTIFICATE-----
-#> ",""),rs=c(10407,-455422690,750700295,1273478044,1219766253,-2043149878,1421521091))'
+#> ",""),rs=c(10407,-1270566338,-1974607449,-1770377796,-505074803,-1287190294,876610915))'
The printed value may be deployed directly on a remote machine.
@@ -1006,10 +1010,10 @@.args
is used to specify further constant arguments to
.f
- the ‘mean’ and ‘sd’ in the example below:
@@ -1018,13 +1022,13 @@Key advantages: mirai_map(1:3, rnorm, .args = list(mean = 20, sd = 2))[] ) #> [[1]] -#> [1] 21.88944 +#> [1] 20.81024 #> #> [[2]] -#> [1] 17.87407 20.08740 +#> [1] 20.01379 15.56526 #> #> [[3]] -#> [1] 21.64744 18.48347 16.43075
Use ...
to further specify objects referenced but not
defined in .f
- the ‘do’ in the anonymous function
below:
Use of mirai_map()
assumes that daemons()
have previously been set. If not then one (non-dispatcher) daemon is set
to allow the function to proceed. This ensures safe behaviour, but is
diff --git a/pkgdown.yml b/pkgdown.yml
index d1c0629e..b058622a 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -9,7 +9,7 @@ articles:
promises: promises.html
shiny: shiny.html
torch: torch.html
-last_built: 2024-11-24T12:32Z
+last_built: 2024-11-24T20:14Z
urls:
reference: https://shikokuchuo.net/mirai/reference
article: https://shikokuchuo.net/mirai/articles
diff --git a/reference/host_url.html b/reference/host_url.html
index 68f67d70..bbdaf647 100644
--- a/reference/host_url.html
+++ b/reference/host_url.html
@@ -109,16 +109,16 @@
host_url()
-#> [1] "tcp://fv-az1014-800:0"
+#> [1] "tcp://fv-az714-367:0"
host_url(ws = TRUE)
-#> [1] "ws://fv-az1014-800:0"
+#> [1] "ws://fv-az714-367:0"
host_url(tls = TRUE)
-#> [1] "tls+tcp://fv-az1014-800:0"
+#> [1] "tls+tcp://fv-az714-367:0"
host_url(ws = TRUE, tls = TRUE, port = 5555)
-#> [1] "wss://fv-az1014-800:5555"
+#> [1] "wss://fv-az714-367:5555"
local_url()
-#> [1] "abstract://4071c1c258a3ad810b8509c6"
+#> [1] "abstract://5474643ea79ef70e0b1970c3"
Evaluate an expression with daemons that last for the duration of the -expression.
+expression. Ensure each mirai within the statement is explicitly called (or +their values collected) so that daemons are not reset before they have all +completed.