Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wajid7511/tasks_cancellation_token
Repository showcasing examples of asynchronous programming in C#. It covers essential techniques like async/await, Task Parallel Library (TPL), handling concurrency, and task cancellation for building responsive and high-performance applications. Ideal for developers looking to enhance their async programming skills.
https://github.com/wajid7511/tasks_cancellation_token
c-sharp cancellationtoken progress progress-bar tasks
Last synced: about 1 month ago
JSON representation
Repository showcasing examples of asynchronous programming in C#. It covers essential techniques like async/await, Task Parallel Library (TPL), handling concurrency, and task cancellation for building responsive and high-performance applications. Ideal for developers looking to enhance their async programming skills.
- Host: GitHub
- URL: https://github.com/wajid7511/tasks_cancellation_token
- Owner: wajid7511
- License: mit
- Created: 2024-09-14T18:08:45.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T05:25:23.000Z (2 months ago)
- Last Synced: 2024-09-30T12:21:04.309Z (about 2 months ago)
- Topics: c-sharp, cancellationtoken, progress, progress-bar, tasks
- Language: HTML
- Homepage:
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Task Cancellation in Blazor
This Blazor project demonstrates how to manage and cancel asynchronous tasks using `CancellationTokenSource`. It includes real-time progress tracking and task cancellation features.
## Features
- **Task Cancellation**: Uses `CancellationTokenSource` to cancel running tasks.
- **Progress Tracking**: Monitors and displays task progress with `IProgress`.
- **Async/Await**: Implements asynchronous programming for non-blocking UI updates.
- **Real-Time UI Updates**: Utilizes `StateHasChanged` to refresh the UI dynamically.## Getting Started
To run this project locally, follow these steps:
1. **Clone the Repository**
```bash
git clone https://github.com/wajid7511/tasks_cancellation_token.git
```2. **Navigate to the Project Directory**
```bash
cd PregressiveApp
```3. **Run the Project**
Use your preferred IDE or command line to run the Blazor project:
```bash
dotnet run
```4. **Open in Browser**
Navigate to `http://localhost:5000` (or the specified port) in your web browser to see the application in action.## Usage
- Click **Run Tasks** to start asynchronous tasks.
- Monitor the progress of each task through the progress bars.
- Click on **Corresponding** button to cancel the corresponding task.## Code Overview
- **`Pages/Index.razor`**: Contains the Blazor page with UI elements for task control and progress display.
- **`@code` Block**: Manages task execution, cancellation, and UI updates.## Contributing
Feel free to submit issues, feature requests, or pull requests. Contributions are welcome!
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact
For any questions or feedback, please contact [Wajid Nazar Muhammad](mailto:[email protected]).