Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. //public IActionResult PulseNest()
  2. public async Task<ActionResult> PulseNest()
  3. {
  4. ViewData["Title"] = "PulseNest";
  5. Listener nl = new Listener();
  6. nl.startListening();
  7. return View();
  8. }
  9.  
  10. public async void startListening()
  11. {
  12. listen([...]);
  13. drawing();
  14. }
  15.  
  16. [...]
  17.  
  18. private async Task drawing()
  19. {
  20. do
  21. {
  22. if (pool.Count > 0)
  23. {
  24. //This is the call for the SignalR sending data to the front
  25. await uH.SendNewPoint(pool[rdm.Next(0, pool.Count - 1)]);
  26. }
  27. } while (true);
  28. }
  29.  
  30. [...]
  31.  
  32. private async Task listen([...])
  33. {
  34. //[Retrieving Data]
  35. processData([...]);
  36.  
  37. }
  38. [...]
  39.  
  40. private void processData([...])
  41. {
  42. //[Processing the data and adding it to the pool]
  43. }
  44.  
  45. Listener nl = new Listener();
  46. Task listening = nl.startListening();
  47. listening.Start();
  48. return View();
  49.  
  50. public async Task startListening()
  51. {
  52. Task listening = listen([...]);
  53. listening.Start();
  54. Task draw = drawing();
  55. draw.Start();
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement