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

Class Method Details

.ready(awaitable, at_most) ⇒ Fear::Awaitable

Blocks until Fear::Awaitable reached completed state and returns itself or raises TimeoutError

Parameters:

Returns:

Raises:

  • (Timeout::Error)


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

Parameters:

Returns:

  • (any)

Raises:

  • (Timeout::Error)


29
30
31
# File 'lib/fear/await.rb', line 29

module_function def result(awaitable, at_most)
  awaitable.__result__(at_most)
end