Class: Airflow::Future

Inherits:
Object
  • Object
show all
Defined in:
lib/async_flow/future.rb

Instance Method Summary collapse

Constructor Details

#initializeFuture

Returns a new instance of Future.



5
6
7
8
9
10
# File 'lib/async_flow/future.rb', line 5

def initialize
  @task = Async do |task|
    task.annotate "Future"
    @result = yield
  end
end

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/async_flow/future.rb', line 17

def ready?
  @task.completed?
end

#valueObject



12
13
14
15
# File 'lib/async_flow/future.rb', line 12

def value
  @task.wait
  @result
end