Class: Quark::MdkRuntime::QuarkRuntimeWebSockets
Constant Summary
DatawireQuarkCore::Static::Unassigned
Instance Attribute Summary collapse
Instance Method Summary
collapse
_lazy_statics, static, unlazy_statics
#to_s
Constructor Details
Returns a new instance of QuarkRuntimeWebSockets.
1200
1201
1202
1203
1204
|
# File 'lib/mdk_runtime.rb', line 1200
def initialize()
self.__init_fields__
nil
end
|
Instance Attribute Details
#connections ⇒ Object
Returns the value of attribute connections.
1192
1193
1194
|
# File 'lib/mdk_runtime.rb', line 1192
def connections
@connections
end
|
#dispatcher ⇒ Object
Returns the value of attribute dispatcher.
1192
1193
1194
|
# File 'lib/mdk_runtime.rb', line 1192
def dispatcher
@dispatcher
end
|
#logger ⇒ Object
Returns the value of attribute logger.
1192
1193
1194
|
# File 'lib/mdk_runtime.rb', line 1192
def logger
@logger
end
|
Instance Method Details
#__init_fields__ ⇒ Object
1284
1285
1286
1287
1288
1289
1290
1291
|
# File 'lib/mdk_runtime.rb', line 1284
def __init_fields__()
self.logger = ::Quark.quark._getLogger("protocol")
self.dispatcher = nil
self.connections = ::DatawireQuarkCore::List.new([])
nil
end
|
#_getClass ⇒ Object
1246
1247
1248
1249
1250
1251
|
# File 'lib/mdk_runtime.rb', line 1246
def _getClass()
return "mdk_runtime.QuarkRuntimeWebSockets"
nil
end
|
#_getField(name) ⇒ Object
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
|
# File 'lib/mdk_runtime.rb', line 1253
def _getField(name)
if ((name) == ("logger"))
return (self).logger
end
if ((name) == ("dispatcher"))
return (self).dispatcher
end
if ((name) == ("connections"))
return (self).connections
end
return nil
nil
end
|
#_setField(name, value) ⇒ Object
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
|
# File 'lib/mdk_runtime.rb', line 1269
def _setField(name, value)
if ((name) == ("logger"))
(self).logger = value
end
if ((name) == ("dispatcher"))
(self).dispatcher = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_runtime.actors.MessageDispatcher }
end
if ((name) == ("connections"))
(self).connections = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List }
end
nil
end
|
#connect(url, originator) ⇒ Object
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
|
# File 'lib/mdk_runtime.rb', line 1209
def connect(url, originator)
@logger.debug((((originator).to_s) + ("requested connection to ")) + (url))
factory = ::Quark.mdk_runtime.promise.PromiseResolver.new((self).dispatcher)
actor = ::Quark.mdk_runtime.QuarkRuntimeWSActor.new(url, originator, factory)
(@connections) << (actor)
(self).dispatcher.startActor(actor)
return (factory).promise
nil
end
|
#onMessage(origin, message) ⇒ Object
1228
1229
1230
1231
1232
1233
|
# File 'lib/mdk_runtime.rb', line 1228
def onMessage(origin, message)
nil
nil
end
|
#onStart(dispatcher) ⇒ Object
1221
1222
1223
1224
1225
1226
|
# File 'lib/mdk_runtime.rb', line 1221
def onStart(dispatcher)
(self).dispatcher = dispatcher
nil
end
|
#onStop ⇒ Object
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
|
# File 'lib/mdk_runtime.rb', line 1235
def onStop()
idx = 0
while ((idx) < ((@connections).size)) do
(self).dispatcher.tell(self, ::Quark.mdk_runtime.WSClose.new(), ((self).connections)[idx])
idx = (idx) + (1)
end
nil
end
|