Skip to content

Instantly share code, notes, and snippets.

@lbialy
Created June 30, 2026 12:37
Show Gist options
  • Select an option

  • Save lbialy/7ca559d3b978bfe341ec6f366baff576 to your computer and use it in GitHub Desktop.

Select an option

Save lbialy/7ca559d3b978bfe341ec6f366baff576 to your computer and use it in GitHub Desktop.
par — platform JS (R[A]=Future[A]) — scala/toolkit#31
import scala.concurrent.*
object platform:
type R[A] = Future[A]
def parRun[A](parallelism: Int)(body: ExecutionContext => Future[A]): R[A] =
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
body(summon[ExecutionContext])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment