Adding support for transforming functions into Callable objects and integration with ExecutorService.

This commit is contained in:
Hiram Chirino
2012-07-18 14:55:50 -04:00
parent 7cbb8a19fb
commit ac434d4852
3 changed files with 39 additions and 0 deletions
@@ -18,4 +18,14 @@ class ThreadTest {
}
assertTrue(countDown.await(2, SECONDS), "Count down is executed")
}
test fun callableInvoke() {
val pool = Executors.newFixedThreadPool(1).sure()
val future = pool<String> {
"Hello"
}
assertEquals("Hello", future.get(2, SECONDS))
}
}