public static DeclareSignalIdRequireHandlerAsyncTickPriorityCopyBinder DeclareSignal <TSignal>(this DiContainer container)
        {
            var signalBindInfo = CreateDefaultSignalDeclarationBindInfo(container, typeof(TSignal));

            var bindInfo = container.Bind <SignalDeclaration>().AsCached()
                           .WithArguments(signalBindInfo).WhenInjectedInto(typeof(SignalBus), typeof(SignalDeclarationAsyncInitializer)).BindInfo;

            var signalBinder = new DeclareSignalIdRequireHandlerAsyncTickPriorityCopyBinder(signalBindInfo);

            signalBinder.AddCopyBindInfo(bindInfo);
            return(signalBinder);
        }
Esempio n. 2
0
        public static DeclareSignalIdRequireHandlerAsyncTickPriorityCopyBinder DeclareSignal <TSignal>(this DiContainer container)
        {
            var signalBindInfo = new SignalDeclarationBindInfo(typeof(TSignal));

            signalBindInfo.RunAsync = container.Settings.Signals.DefaultSyncMode == SignalDefaultSyncModes.Asynchronous;
            signalBindInfo.MissingHandlerResponse = container.Settings.Signals.MissingHandlerDefaultResponse;
            signalBindInfo.TickPriority           = container.Settings.Signals.DefaultAsyncTickPriority;

            var bindInfo = container.Bind <SignalDeclaration>().AsCached()
                           .WithArguments(signalBindInfo).WhenInjectedInto(typeof(SignalBus), typeof(SignalDeclarationAsyncInitializer)).BindInfo;

            var signalBinder = new DeclareSignalIdRequireHandlerAsyncTickPriorityCopyBinder(signalBindInfo);

            signalBinder.AddCopyBindInfo(bindInfo);
            return(signalBinder);
        }