Created
June 7, 2019 06:20
-
-
Save chriskuech/c228edae8108555f41edca79f8ee5c66 to your computer and use it in GitHub Desktop.
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 outer scope contains only immutable variables | |
$var = & { | |
# this scope contains mutable temporary variables | |
$queue = [System.Collections.Generic]::new() | |
$queue.Enqueue(@{Id = 1}) | |
while ($queue.Count) { | |
$jobInfo = $queue.Dequeue() | |
$newJobInfo = Update-RemoteJob $jobInfo # non-deterministic | |
if ($newJobInfo) { | |
$queue.Enqueue($newJobInfo) | |
} | |
} | |
Get-RemoteResult # output a value to assign to `$var` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment