iipEventEventOccurred method
void
iipEventEventOccurred(
- int resourceId,
- int index,
- DC content
)
Implementation
void iipEventEventOccurred(int resourceId, int index, DC content) {
fetch(resourceId).then((r) {
// push to the queue to gaurantee serialization
var item = new AsyncReply<DistributedResourceQueueItem>();
_queue.add(item);
Codec.parse(content, 0, this).then((arguments) {
var et = r.instance?.template.getEventTemplateByIndex(index);
if (et != null) {
item.trigger(new DistributedResourceQueueItem(
r, DistributedResourceQueueItemType.Event, arguments, index));
} else {
// ft found, fi not found, this should never happen
_queue.remove(item);
}
});
});
/*
if (resources.Contains(resourceId))
{
// push to the queue to gaurantee serialization
var reply = new AsyncReply<DistributedResourceQueueItem>();
var r = resources[resourceId];
queue.Add(reply);
Codec.parseVarArray(content, this).then((arguments) =>
{
if (!r.IsAttached)
{
// event occurred before the template is received
r.AddAfterAttachement(reply,
new DistributedResourceQueueItem((DistributedResource)r,
DistributedResourceQueueItem.DistributedResourceQueueItemType.Event, arguments, index));
}
else
{
var et = r.instance.template.GetEventTemplate(index);
if (et != null)
{
reply.trigger(new DistributedResourceQueueItem((DistributedResource)r,
DistributedResourceQueueItem.DistributedResourceQueueItemType.Event, arguments, index));
}
else
{ // ft found, fi not found, this should never happen
queue.Remove(reply);
}
}
});
}
*/
}