Class: Quark::Quark::Concurrent::FutureCompletion
- Inherits:
-
DatawireQuarkCore::QuarkObject
- Object
- DatawireQuarkCore::QuarkObject
- Quark::Quark::Concurrent::FutureCompletion
- Extended by:
- DatawireQuarkCore::Static
- Defined in:
- lib/quark/concurrent.rb
Overview
internal class that binds a listener to a future
Constant Summary
Constants included from DatawireQuarkCore::Static
DatawireQuarkCore::Static::Unassigned
Instance Attribute Summary collapse
-
#future ⇒ Object
Returns the value of attribute future.
-
#listener ⇒ Object
Returns the value of attribute listener.
Instance Method Summary collapse
- #__init_fields__ ⇒ Object
- #_getClass ⇒ Object
- #_getField(name) ⇒ Object
- #_setField(name, value) ⇒ Object
- #fireEvent ⇒ Object
- #getContext ⇒ Object
-
#initialize(future, listener) ⇒ FutureCompletion
constructor
A new instance of FutureCompletion.
Methods included from DatawireQuarkCore::Static
_lazy_statics, static, unlazy_statics
Methods inherited from DatawireQuarkCore::QuarkObject
Constructor Details
#initialize(future, listener) ⇒ FutureCompletion
Returns a new instance of FutureCompletion.
105 106 107 108 109 110 111 112 |
# File 'lib/quark/concurrent.rb', line 105 def initialize(future, listener) self.__init_fields__ (self).future = future (self).listener = listener nil end |
Instance Attribute Details
#future ⇒ Object
Returns the value of attribute future.
98 99 100 |
# File 'lib/quark/concurrent.rb', line 98 def future @future end |
#listener ⇒ Object
Returns the value of attribute listener.
98 99 100 |
# File 'lib/quark/concurrent.rb', line 98 def listener @listener end |
Instance Method Details
#__init_fields__ ⇒ Object
163 164 165 166 167 168 169 |
# File 'lib/quark/concurrent.rb', line 163 def __init_fields__() self.future = nil self.listener = nil nil end |
#_getClass ⇒ Object
131 132 133 134 135 136 |
# File 'lib/quark/concurrent.rb', line 131 def _getClass() return "quark.concurrent.FutureCompletion" nil end |
#_getField(name) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/quark/concurrent.rb', line 138 def _getField(name) if ((name) == ("future")) return (self).future end if ((name) == ("listener")) return (self).listener end return nil nil end |
#_setField(name, value) ⇒ Object
151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/quark/concurrent.rb', line 151 def _setField(name, value) if ((name) == ("future")) (self).future = ::DatawireQuarkCore.cast(value) { ::Quark.quark.concurrent.Future } end if ((name) == ("listener")) (self).listener = ::DatawireQuarkCore.cast(value) { ::Quark.quark.concurrent.FutureListener } end nil end |
#fireEvent ⇒ Object
124 125 126 127 128 129 |
# File 'lib/quark/concurrent.rb', line 124 def fireEvent() (self).listener.onFuture((self).future) nil end |
#getContext ⇒ Object
117 118 119 120 121 122 |
# File 'lib/quark/concurrent.rb', line 117 def getContext() return (self).future nil end |