Exemple #1
0
 public ApplicationHub(
     IStateMonitor <State> stateMonitor,
     IOptionsMonitor <Options> optionsMonitor)
 {
     StateMonitor   = stateMonitor;
     OptionsMonitor = optionsMonitor;
 }
Exemple #2
0
 public ShowsController(IShowsRepositroy showsRepositroy,
                        ITvMazeWebAccessor tvMazeWebAccessor, IStateMonitor stateMonitor, ILogger <ShowsController> logger)
 {
     _showsRepositroy   = showsRepositroy;
     _tvMazeWebAccessor = tvMazeWebAccessor;
     _stateMonitor      = stateMonitor;
     _logger            = logger;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="ConversationsController"/> class.
 /// </summary>
 /// <param name="soulseekClient"></param>
 /// <param name="applicationStateMonotor"></param>
 /// <param name="tracker"></param>
 public ConversationsController(
     ISoulseekClient soulseekClient,
     IStateMonitor <State> applicationStateMonotor,
     IConversationTracker tracker)
 {
     Client = soulseekClient;
     ApplicationStateMonitor = applicationStateMonotor;
     Tracker = tracker;
 }
Exemple #4
0
 public ApplicationController(
     IHostApplicationLifetime lifetime,
     IApplication application,
     IOptionsMonitor <Options> optionsMonitor,
     IStateMonitor <State> applicationStateMonitor)
 {
     Lifetime                = lifetime;
     Application             = application;
     OptionsMonitor          = optionsMonitor;
     ApplicationStateMonitor = applicationStateMonitor;
 }
Exemple #5
0
 public RoomsController(
     ISoulseekClient soulseekClient,
     IRoomService roomService,
     IStateMonitor <State> applicationStateMonitor,
     IRoomTracker tracker)
 {
     Client = soulseekClient;
     ApplicationStateMonitor = applicationStateMonitor;
     Tracker     = tracker;
     RoomService = roomService;
 }
Exemple #6
0
        /// <summary>
        /// Scoped State constructor.
        /// This should be called by either the State object or the Dependency Injection system.
        /// </summary>
        /// <param name="parentState">The parent state to this scoped state</param>
        /// <param name="scopedStateFactory">The scope state factory</param>
        /// <param name="store">The dta store for this scoped state</param>
        /// <param name="monitor">The state monitor service for this scoped state</param>
        public ScopedState(IState parentState,
                           IScopedStateFactory scopedStateFactory,
                           IIgnitorStore <TId, TEntity> store,
                           IStateMonitor <TId, TEntity> monitor) :
            base(scopedStateFactory)
        {
            _parentState = parentState;

            _store   = store;
            _monitor = monitor;

            // Id selector defaults
            _idProperty = GetIdProperty();
            _idSelector = (entity) => (TId)_idProperty.GetValue(entity);
        }
Exemple #7
0
        private static readonly int ReconnectMaxDelayMilliseconds = 300000; // 5 minutes

        /// <summary>
        ///     Initializes a new instance of the <see cref="ConnectionWatchdog"/> class.
        /// </summary>
        /// <param name="soulseekClient"></param>
        /// <param name="optionsMonitor"></param>
        /// <param name="state"></param>
        public ConnectionWatchdog(
            ISoulseekClient soulseekClient,
            IOptionsMonitor <Options> optionsMonitor,
            IStateMonitor <State> state)
        {
            Client  = soulseekClient;
            Options = optionsMonitor;
            State   = state;

            WatchdogTimer = new System.Timers.Timer()
            {
                Interval  = 100,
                AutoReset = true,
                Enabled   = false,
            };

            WatchdogTimer.Elapsed += (sender, args) => _ = AttemptReconnect();
        }
Exemple #8
0
 public SingleStateUpdater(IStateMonitor <TId, TEntity> notifier, IIgnitorStore <TId, TEntity> store, TId id)
 {
     _notifier = (IStateSignaling <TId, TEntity>)notifier;
     _store    = store;
     _id       = id;
 }
Exemple #9
0
 public StateUpdater(IStateMonitor <TId, TEntity> notifier, IIgnitorStore <TId, TEntity> store)
 {
     _notifier = (IStateSignaling <TId, TEntity>)notifier;
     _store    = store;
 }
Exemple #10
0
 /// <summary>
 /// Called when application is started.
 /// </summary>
 private new void Start()
 {
     base.Start();
     StateMonitor = GetComponent <IStateMonitor>();
 }
 public MachineStateController(IStateMonitor stateMonitor)
 {
     this.monitor = stateMonitor;
 }