Other DSL
par
This utility is provided to support running multiple tasks in parallel. A call to par
returns when all the submitted tasks complete.
The following example demonstrates sending commands in parallel to multiple HCD’s.
- Kotlin
-
val prefix = "OCS.IRIS_darkMode" val hcd1 = Hcd(IRIS, "filter.wheel1", 10.minutes) val hcd2 = Hcd(IRIS, "filter.wheel2", 10.minutes) val hcd3 = Hcd(IRIS, "filter.wheel3", 10.minutes) onSetup("setup-iris-hcds") { // send 3 setup commands to 3 HCD's in parallel val responses: List<SubmitResponse> = par( { hcd1.submitAndWait(Setup(prefix, "move-10")) }, { hcd2.submitAndWait(Setup(prefix, "move-10")) }, { hcd3.submitAndWait(Setup(prefix, "move-10")) } ) }
Source code for examples
0.1.0-RC1