Class: Ori::Scope::ThreadLocalState
- Inherits:
-
Object
- Object
- Ori::Scope::ThreadLocalState
- Defined in:
- lib/ori/scope.rb
Overview
Add thread-local state management
Instance Attribute Summary collapse
-
#blocked ⇒ Object
readonly
Returns the value of attribute blocked.
-
#fiber_ids ⇒ Object
readonly
Returns the value of attribute fiber_ids.
-
#pending ⇒ Object
readonly
Returns the value of attribute pending.
-
#readable ⇒ Object
readonly
Returns the value of attribute readable.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
-
#waiting ⇒ Object
readonly
Returns the value of attribute waiting.
-
#writable ⇒ Object
readonly
Returns the value of attribute writable.
Instance Method Summary collapse
- #child_scopes ⇒ Object
- #child_scopes? ⇒ Boolean
-
#initialize ⇒ ThreadLocalState
constructor
A new instance of ThreadLocalState.
Constructor Details
#initialize ⇒ ThreadLocalState
Returns a new instance of ThreadLocalState.
19 20 21 22 23 24 25 26 27 |
# File 'lib/ori/scope.rb', line 19 def initialize @fiber_ids = LazyHash.new @tasks = LazyHash.new @pending = LazyArray.new @readable = LazyHashSet.new @writable = LazyHashSet.new @waiting = LazyHash.new @blocked = LazyHash.new end |
Instance Attribute Details
#blocked ⇒ Object (readonly)
Returns the value of attribute blocked.
11 12 13 |
# File 'lib/ori/scope.rb', line 11 def blocked @blocked end |
#fiber_ids ⇒ Object (readonly)
Returns the value of attribute fiber_ids.
11 12 13 |
# File 'lib/ori/scope.rb', line 11 def fiber_ids @fiber_ids end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
11 12 13 |
# File 'lib/ori/scope.rb', line 11 def pending @pending end |
#readable ⇒ Object (readonly)
Returns the value of attribute readable.
11 12 13 |
# File 'lib/ori/scope.rb', line 11 def readable @readable end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
11 12 13 |
# File 'lib/ori/scope.rb', line 11 def tasks @tasks end |
#waiting ⇒ Object (readonly)
Returns the value of attribute waiting.
11 12 13 |
# File 'lib/ori/scope.rb', line 11 def waiting @waiting end |
#writable ⇒ Object (readonly)
Returns the value of attribute writable.
11 12 13 |
# File 'lib/ori/scope.rb', line 11 def writable @writable end |
Instance Method Details
#child_scopes ⇒ Object
29 30 31 |
# File 'lib/ori/scope.rb', line 29 def child_scopes @child_scopes ||= Set.new end |
#child_scopes? ⇒ Boolean
33 34 35 |
# File 'lib/ori/scope.rb', line 33 def child_scopes? defined?(@child_scopes) && !@child_scopes.empty? end |