feat: add panic tracking and logging with PanicTracker
- Implemented PanicTracker to log panics using tracing within a dedicated span. - Introduced PanicInfo struct to capture panic details. - Added tests for panic catching and hook restoration. feat: implement token-bucket rate limiter - Created RateLimiter to manage token consumption with configurable rates and burst capacity. - Added methods for acquiring tokens and checking available tokens. - Included tests for rate limiting behavior and token availability. feat: add automatic retry with exponential backoff - Developed retry function to handle transient errors with configurable retry strategies. - Introduced RetryConfig for customizing retry behavior and jitter. - Added tests for various retry scenarios and error handling. feat: implement graceful shutdown coordination - Created ShutdownManager to manage shutdown signals and task completion. - Introduced ShutdownSignal for tasks to observe shutdown requests. - Added tests for shutdown request handling and task draining. feat: add timeout functionality for async operations - Implemented with_timeout function to enforce execution time limits on futures. - Created Timeout struct for wrapping futures with a deadline. - Added tests for timeout behavior and error mapping.
This commit is contained in:
1 parent
ca39dea5db
commit
d119821339
76 files changed
+10360
-191
No files matched your search
@@ -0,0 +1,26 @@
|
||||
# corex-storage
|
||||
|
||||
A unified storage & file system abstraction so file handling isn't locked to
|
||||
one physical location.
|
||||
|
||||
- **Local disk** (default) — plain files under a root directory.
|
||||
- **S3-compatible object storage** (`s3`) — Amazon S3, and any S3-compatible
|
||||
endpoint (MinIO included) via a custom endpoint URL.
|
||||
- **Google Cloud Storage** (`gcs`).
|
||||
|
||||
All operations are stream-based, so uploading/downloading a huge object never
|
||||
requires holding it entirely in memory.
|
||||
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use corex_storage::{LocalFileStorage, StorageDriver, bytes_stream, read_to_vec};
|
||||
|
||||
let storage = LocalFileStorage::new("/var/data");
|
||||
storage.put("uploads/report.csv", bytes_stream(data)).await?;
|
||||
let bytes = read_to_vec(storage.get("uploads/report.csv").await?).await?;
|
||||
```
|
||||
|
||||
Swap `LocalFileStorage::new(path)` for `S3Storage::connect("bucket").await?` or
|
||||
`GcsStorage::connect("bucket").await?` to move to a distributed backend
|
||||
without touching call sites.
|
||||
Reference in new issue
Block a user