Performance async task management with priority queues, automatic retries, and pause/resume capabilities for .NET
Requests transforms chaotic async workflows into manageable, priority-driven operations. Built for developers who need more than basic task scheduling—think game engines, batch processors, API orchestrators, and complex data pipelines.
- Priority Scheduling: High-priority requests jump the queue automatically
- Smart Retries: Configurable retry logic with exponential backoff
- Pause & Resume: Stop and restart long-running operations without data loss
- Progress Tracking: Real-time aggregated progress across multiple operations
- Dynamic Parallelism: Auto-adjusts concurrency based on system load
- Zero Lock-in: Simple wrapper pattern around your existing async code
dotnet add package Shard.Requestsusing Shard.Requests;
// Wrap any async operation
var request = new OwnRequest(async token =>
{
var response = await httpClient.GetAsync(url, token);
return response.IsSuccessStatusCode;
}, new() {
Priority = RequestPriority.High,
NumberOfAttempts = 3,
DelayBetweenAttempts = TimeSpan.FromSeconds(2)
});
// Request auto-starts with built-in retry and priority handling
await request.Task;- Request: Base class for all operations with state machine and lifecycle hooks
- RequestHandler: Parallel or sequential execution engines with priority channels
- RequestContainer: Group multiple requests with unified control
- ProgressableContainer: Track aggregated progress across request batches
- OwnRequest: Zero-boilerplate wrapper for ad-hoc async operations
- Cooperative Cancellation:
await Request.Yield()for graceful interruption - Subsequent Requests: Chain operations without re-queuing
- Quaternary Heap: O(log n) priority queue with FIFO ordering within priority levels
- Batch Processing: Download 1000 files with 10 parallel workers and retry failed transfers
- Game Development: Priority-ordered asset loading with pause when backgrounded
- API Rate Limiting: Throttle concurrent requests with dynamic parallelism control
- Long Operations: Multi-hour processes with save/resume support
Wiki Architecture deep-dives, examples, and API reference
Built for developers who need industrial-strength async control without the complexity