A ultra-simple implementation of the Barrier flow control pattern in Javascript