wren-lang / wren-cli

A command line tool for the Wren programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFC] Scheduler.await

joshgoebel opened this issue · comments

I already spotted the call extern/Scheduler.runNextScheduled_() pattern:

  static mkdir(path) {
     ensurePath_(path)
     mkdir_(path, Fiber.current)
     return Scheduler.runNextScheduled_()
     return await { mkdir_(path, Fiber.current) }
   }

And was replacing it with:

  static mkdir(path) {
     ensurePath_(path)
     return await_ { mkdir_(path, Fiber.current) }
   }

But much like #65 it why don't we just move this responsibility into Scheduler:

  static mkdir(path) {
     ensurePath_(path)
     return Scheduler.await_ { mkdir_(path, Fiber.current) }
   }

await is no doubt familiar to those doing async in JavaScript, but open to a better name...