Class: GraphQL::Parallel::ExecutionStrategy
- Inherits:
-
Query::SerialExecution
- Object
- Query::SerialExecution
- GraphQL::Parallel::ExecutionStrategy
show all
- Defined in:
- lib/graphql/parallel/execution_strategy.rb
Defined Under Namespace
Classes: FieldResolution, OperationResolution
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ExecutionStrategy.
4
5
6
7
8
|
# File 'lib/graphql/parallel/execution_strategy.rb', line 4
def initialize
Celluloid.boot unless Celluloid.running?
@has_futures = false
end
|
Instance Method Details
#async(block) ⇒ Object
15
16
17
18
|
# File 'lib/graphql/parallel/execution_strategy.rb', line 15
def async(block)
@has_futures ||= true
pool.future.resolve(block)
end
|
#has_futures? ⇒ Boolean
20
21
22
|
# File 'lib/graphql/parallel/execution_strategy.rb', line 20
def has_futures?
@has_futures
end
|
#pool ⇒ Object
10
11
12
13
|
# File 'lib/graphql/parallel/execution_strategy.rb', line 10
def pool
@pool ||= ExecutionPool.run!
@pool[:execution_worker_pool]
end
|