|
|
|
|
|
by BenoitP
2232 days ago
|
|
A current discussion on the Loom mailing list is about providing Structured Concurrency [1] primitives. It would allow you to write something like: try (var scope = FiberScope.open(Option.PROPAGATE_CANCEL)) {
var fiber1 = scope.schedule(() -> sshKeepAlive());
var fiber2 = scope.schedule(() -> trackHost());
var fiber3 = scope.schedule(() -> trackVMs());
}
With the garantee that if any fiber fails (which you bind to cancelling it), all others will be cancelled.[1] http://250bpm.com/blog:71 |
|