migrated from original wait.for (based on node-fibers)