C#: How do you stop the background flow from the main?



  • Good afternoon.

    I'm-I'm doing self-education, and I'm thinking about it. Tell me, please, how right. Stop the background flow from the mainwithout using any global variables, etc.? I know about CancellationToken, and there are other ways?



  • If correctly, in the flow-rate with some convenience (for the integrity of the data processed), it is not unusual to check a flag of interruption and to complete it smoothly.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2