async sequences and gates, for JS