Guest User

Untitled

a guest
Jan 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. *Application Start - Call Parent Thread
  2. Parent Thread:
  3. Populate Active Game Array from MS SQL
  4. for each item/game in our game-array
  5. If GameID not already running (using application level cache variable?) start a child thread for the gameid
  6. System.Threading.TimerCallback cb_StartBallCaller = new System.Threading.TimerCallback(GameBallCaller);
  7. // Create the object for the timer. Refresh Period = 5 Seconds
  8. clsTime objtime = new clsTime();
  9. bingocalltimer = new System.Threading.Timer(cb_StartBallCaller, objtime, init_waittime, REFRESH_BingoBallCalls_EVERY_SECONDS);
  10. if flag_UdateArrray = true - repopulate game-array from SQL)
  11. end for
  12.  
  13. Child Process:
  14. private static void GameBallCaller(object state)
  15. for each Ball in a Game’s 75 ball array
  16. Stopwatch stopWatch = new Stopwatch();
  17. stopWatch.Start();
  18. Push the ball number to all browser
  19. Update database that ball has been called
  20. stopWatch.Stop();
  21. long duration = stopWatch.ElapsedMilliseconds;
  22. if (duration< 5000)
  23. sleep(5000 - duration)
  24. end if
  25. end for*
Add Comment
Please, Sign In to add comment