Module: Fear::Await
- Defined in:
- lib/fear/await.rb
Overview
You’re strongly discouraged to use this module since it may lead to deadlocks, and reduced performance. Although, blocking may be useful in some cases (e.g. in tests)
Class Method Summary collapse
-
.ready(awaitable, at_most) ⇒ Fear::Awaitable
Blocks until
Fear::Awaitable
reached completed state and returns itself or raisesTimeoutError
. -
.result(awaitable, at_most) ⇒ any
Blocks until
Fear::Awaitable
reached completed state and returns its value or raisesTimeoutError
.
Class Method Details
.ready(awaitable, at_most) ⇒ Fear::Awaitable
Blocks until Fear::Awaitable
reached completed state and returns itself or raises TimeoutError
17 18 19 |
# File 'lib/fear/await.rb', line 17 module_function def ready(awaitable, at_most) awaitable.__ready__(at_most) end |
.result(awaitable, at_most) ⇒ any
Blocks until Fear::Awaitable
reached completed state and returns its value or raises TimeoutError
29 30 31 |
# File 'lib/fear/await.rb', line 29 module_function def result(awaitable, at_most) awaitable.__result__(at_most) end |