Exemple #1
0
        public SignalBus(
            [Inject(Source = InjectSources.Local)]
            List <SignalDeclaration> signalDeclarations,
            [Inject(Source = InjectSources.Parent, Optional = true)]
            SignalBus parentBus,
            [InjectOptional]
            UniDiSettings UniDiSettings,
            SignalSubscription.Pool subscriptionPool,
            SignalDeclaration.Factory signalDeclarationFactory,
            DiContainer container)
        {
            _subscriptionPool         = subscriptionPool;
            UniDiSettings             = UniDiSettings ?? UniDiSettings.Default;
            _settings                 = UniDiSettings.Signals ?? UniDiSettings.SignalSettings.Default;
            _signalDeclarationFactory = signalDeclarationFactory;
            _container                = container;

            signalDeclarations.ForEach(x =>
            {
                if (!_localDeclarationMap.ContainsKey(x.BindingId))
                {
                    _localDeclarationMap.Add(x.BindingId, x);
                }
                else
                {
                    _localDeclarationMap[x.BindingId].Subscriptions.AllocFreeAddRange(x.Subscriptions);
                }
            });
            _parentBus = parentBus;
        }
Exemple #2
0
        public SignalDeclaration(
            SignalDeclarationBindInfo bindInfo,
            [InjectOptional]
            UniDiSettings UniDiSettings)
        {
            UniDiSettings = UniDiSettings ?? UniDiSettings.Default;
            _settings     = UniDiSettings.Signals ?? UniDiSettings.SignalSettings.Default;

            _bindingId = new BindingId(bindInfo.SignalType, bindInfo.Identifier);
            _missingHandlerResponses = bindInfo.MissingHandlerResponse;
            _isAsync     = bindInfo.RunAsync;
            TickPriority = bindInfo.TickPriority;
        }