previous | top | next
Structured concurrency: fork-join
f ( a, b, c, ...);
- In SJS function application, arguments a, b, c, ... are evaluated in parallel.
- The function body of f is evaluated when all arguments have finished evaluating.
function fetch_some_feed() { ... }
function fetch_another_feed() { ... }
function wait_for_some_user_input() { ... }
function do_something_with_feeds_and_users_input(a, b, c) { ... }
do_something_with_feeds_and_users_input(
fetch_some_feed(),
fetch_another_feed(),
wait_for_some_user_input()
);
High-level concurrency for JS - http://www.croczilla.com/stratified