Microsoft.AspNet.SignalR.HighFrequencyTimer.Start C# (CSharp) Method

Start() public method

public Start ( ) : bool
return bool
        public bool Start()
        {
            // Try to move to starting state
            if (Interlocked.CompareExchange(ref _state, 1, 0) != 0)
            {
                // Wasn't stopped
                return false;
            }

            // In the starting state now so start the loop
            ThreadPool.QueueUserWorkItem(Run);

            return true;
        }

Usage Example

Ejemplo n.º 1
0
        private Game()
        {
            Configuration = new GameConfigurationManager();
            DRAW_AFTER = Configuration.gameConfig.DRAW_INTERVAL / Configuration.gameConfig.UPDATE_INTERVAL;
            _drawFPS = 1000 / Configuration.gameConfig.DRAW_INTERVAL;
            _gameLoop = new HighFrequencyTimer(1000 / Configuration.gameConfig.UPDATE_INTERVAL, id => Update(id), () => { }, () => { }, (fps) =>
            {
                _actualFPS = fps;
            });
            _leaderboardLoop = new Timer(UpdateLeaderboard, null, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL, Configuration.gameConfig.LEADERBOARD_PUSH_INTERVAL);

            _gameTime = new GameTime();
            _space = new Map();
            GameHandler = new GameHandler(_space);
            _payloadManager = new PayloadManager();

            UserHandler = new UserHandler(GameHandler);
            Leaderboard = new Leaderboard(UserHandler);
            ConnectionManager = new ConnectionManager(UserHandler, _locker);

            RegistrationHandler = new RegistrationHandler();
            RuntimeConfiguration = new RuntimeConfiguration();

            _gameLoop.Start();
        }
All Usage Examples Of Microsoft.AspNet.SignalR.HighFrequencyTimer::Start