예제 #1
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            var groupId = GroupId.GetFirstValue(payload.Data);

            var singleElement = SingleElement.GetFirstValue(payload.Data);

            var targetElementCount = NumberOfEntries.GetFirstValue(payload.Data);

            if (!DataShare.ContainsKey(groupId))
            {
                DataShare[groupId] = new List <MutableObject>();
            }
            DataShare[groupId].Add(singleElement);

            if (DataShare[groupId].Count >= targetElementCount)
            {
                var dataList = DataShare[groupId];
                RecombinedListTarget.SetValue(dataList, payload.Data);

                DataShare[groupId] = new List <MutableObject>();

                var iterator = Router.TransmitAll(payload);
                while (iterator.MoveNext())
                {
                    yield return(null);
                }
            }
        }
예제 #2
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            RecombinedListTarget.SetValue(new List <MutableObject>
            {
                SingleElement.GetFirstValue(newSchema)
            }, newSchema);

            Router.TransmitAllSchema(newSchema);
        }