Last active
November 3, 2015 21:22
-
-
Save nuclearace/20a9d69f2abc50690882 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
| object Main extends App { | |
| implicit val queue: dispatch.queue = "goodbyeQueue" | |
| def sayHello = () => {println("hello")} | |
| def sayGoodbye = () => {println("goodbye")} | |
| dispatch.async(sayHello)("helloQueue") | |
| dispatch async sayGoodbye | |
| } | |
| object dispatch { | |
| type queue = String | |
| def async(cb: () => Unit)(implicit queue: queue) = { | |
| println(s"Executing in $queue") | |
| cb() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment