Created
September 22, 2014 21:48
-
-
Save djspiewak/ec901a75be5211a85b08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.ExecutorService | |
def fork[A](t: Task[A])(implicit pool: ExecutorService = Strategy.DefaultExecutorService): Task[A] = { | |
Task async { cb => | |
t runAsync { either => | |
pool.submit(new Runnable { | |
def run(): Unit = cb(either) | |
}) | |
() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment