Class: Quark::Quark::Concurrent::FutureCompletion

Inherits:
DatawireQuarkCore::QuarkObject show all
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

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Methods inherited from DatawireQuarkCore::QuarkObject

#to_s

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

#futureObject

Returns the value of attribute future.



98
99
100
# File 'lib/quark/concurrent.rb', line 98

def future
  @future
end

#listenerObject

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

#_getClassObject



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

#fireEventObject



124
125
126
127
128
129
# File 'lib/quark/concurrent.rb', line 124

def fireEvent()
    
    (self).listener.onFuture((self).future)

    nil
end

#getContextObject



117
118
119
120
121
122
# File 'lib/quark/concurrent.rb', line 117

def getContext()
    
    return (self).future

    nil
end