Class: Quark::MdkRuntime::Promise::Callback

Inherits:
DatawireQuarkCore::QuarkObject show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/mdk_runtime/promise.rb

Constant Summary

Constants included from DatawireQuarkCore::Static

DatawireQuarkCore::Static::Unassigned

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Methods inherited from DatawireQuarkCore::QuarkObject

#to_s

Constructor Details

#initialize(callable, next_) ⇒ Callback

Returns a new instance of Callback.



190
191
192
193
194
195
196
197
# File 'lib/mdk_runtime/promise.rb', line 190

def initialize(callable, next_)
    
    self.__init_fields__
    (self)._callable = callable
    (self)._next = next_

    nil
end

Instance Attribute Details

#_callableObject

Returns the value of attribute _callable.



183
184
185
# File 'lib/mdk_runtime/promise.rb', line 183

def _callable
  @_callable
end

#_nextObject

Returns the value of attribute _next.



183
184
185
# File 'lib/mdk_runtime/promise.rb', line 183

def _next
  @_next
end

Instance Method Details

#__init_fields__Object



242
243
244
245
246
247
248
# File 'lib/mdk_runtime/promise.rb', line 242

def __init_fields__()
    
    self._callable = nil
    self._next = nil

    nil
end

#_getClassObject



210
211
212
213
214
215
# File 'lib/mdk_runtime/promise.rb', line 210

def _getClass()
    
    return "mdk_runtime.promise._Callback"

    nil
end

#_getField(name) ⇒ Object



217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/mdk_runtime/promise.rb', line 217

def _getField(name)
    
    if ((name) == ("_callable"))
        return (self)._callable
    end
    if ((name) == ("_next"))
        return (self)._next
    end
    return nil

    nil
end

#_setField(name, value) ⇒ Object



230
231
232
233
234
235
236
237
238
239
240
# File 'lib/mdk_runtime/promise.rb', line 230

def _setField(name, value)
    
    if ((name) == ("_callable"))
        (self)._callable = ::DatawireQuarkCore.cast(value) { ::Quark.quark.UnaryCallable }
    end
    if ((name) == ("_next"))
        (self)._next = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_runtime.promise.Promise }
    end

    nil
end

#call(result) ⇒ Object



202
203
204
205
206
207
208
# File 'lib/mdk_runtime/promise.rb', line 202

def call(result)
    
    event = ::Quark.mdk_runtime.promise._CallbackEvent.new((self)._callable, (self)._next, result)
    (@_next)._dispatcher._queue(event)

    nil
end