/// <inheritdoc />
        public bool Send <TData>(SignalType <TData> signalType, TData data)
        {
            RemovePendingRemovals();

            var wrapper = (ListWrapper <TData>)_node.Registry.Find(signalType);

            if (wrapper == null)
            {
                return(false);
            }

            using (var options = SignalListenerContext.Push())
            {
                for (int index = 0;
                     options.ShouldContinue && index < wrapper.RegisteredListeners.Count;
                     index++)
                {
                    var item     = wrapper.RegisteredListeners[index];
                    var instance = _sources[item.InstanceIndex];
                    item.SignalListener(instance, data);
                }
            }

            return(true);
        }
Beispiel #2
0
 void IDisposable.Dispose()
 {
     SignalListenerContext.Pop();
 }