2 ms·
So, you basically have what JS calls await Promise.all(a, b) ?
by kuschku 9y ago
So, you basically have what JS calls await Promise.all(a, b) ?
- chrisseaton 9y agoYes you can build fork-join that way, but you'd need to remember to manually follow some rules. You should create the tasks a and b immediately before you await, and do no other work between creating them and awaiting. And you should not cause any side effects in the two tasks. Systems which have fork-join built-in would either help you to follow those rules, or force you to.
- mamcx 9y agoSo, if I understand, you "tasks" are almost pure functions: fork -> send -> task1(input) & task2(input) -> joiner And you must always(?) have a join? so I can't have a zombie task elsewhere? I probably like how this sound! Exist a more detailed material to study on this?