diff --git a/docs/cookbook/src/concepts/handlers.md b/docs/cookbook/src/concepts/handlers.md index a7dfd40..f2e8d15 100644 --- a/docs/cookbook/src/concepts/handlers.md +++ b/docs/cookbook/src/concepts/handlers.md @@ -15,7 +15,7 @@ If the data cannot be extracted (e.g., missing header, invalid JSON), the reques A handler is simply an asynchronous function that takes zero or more **Extractors** as arguments and returns something that implements `IntoResponse`. ```rust -use rustapi::prelude::*; +use rustapi_rs::prelude::*; async fn create_user( State(db): State, // 1. Dependency Injection diff --git a/docs/cookbook/src/learning/README.md b/docs/cookbook/src/learning/README.md index 654b5fb..880d721 100644 --- a/docs/cookbook/src/learning/README.md +++ b/docs/cookbook/src/learning/README.md @@ -19,6 +19,7 @@ If you prefer reading through documentation first, follow this path through the 3. **Building Blocks**: Try the [Creating Resources](../recipes/crud_resource.md) recipe. 4. **Security**: Implement [JWT Authentication](../recipes/jwt_auth.md) and [CSRF Protection](../recipes/csrf_protection.md). 5. **Advanced**: Explore [Performance Tuning](../recipes/high_performance.md) and [HTTP/3](../recipes/http3_quic.md). +6. **Background Jobs**: Master [rustapi-jobs](../crates/rustapi_jobs.md) for async processing. ### Why Use the Examples Repository? @@ -65,8 +66,11 @@ Design and build distributed systems with RustAPI. | 3 | `rate-limit-demo` | API protection, throttling | | 4 | `microservices` | Service communication patterns | | 5 | `microservices-advanced` | Service discovery, Consul integration | +| 6 | Background jobs (conceptual) | Background processing with `rustapi-jobs`, Redis/Postgres backends | +> Note: The **Background jobs (conceptual)** step refers to using the `rustapi-jobs` crate rather than a standalone example project. **Related Cookbook Recipes:** +- [rustapi-jobs](../crates/rustapi_jobs.md) - [Custom Middleware](../recipes/custom_middleware.md) - [Production Tuning](../recipes/high_performance.md) - [Deployment](../recipes/deployment.md) @@ -116,9 +120,11 @@ Build robust, observable, and secure systems. | 2 | **Resilience** | Implement [Circuit Breakers and Retries](../crates/rustapi_extras.md#resilience) | | 3 | **Advanced Security** | Add [OAuth2 and Security Headers](../crates/rustapi_extras.md#advanced-security) | | 4 | **Optimization** | Configure [Caching and Deduplication](../crates/rustapi_extras.md#optimization) | +| 5 | **Background Jobs** | Implement [Reliable Job Queues](../crates/rustapi_jobs.md) | **Related Cookbook Recipes:** - [rustapi-extras: The Toolbox](../crates/rustapi_extras.md) +- [rustapi-jobs: The Workhorse](../crates/rustapi_jobs.md) --- diff --git a/docs/cookbook/src/recipes/db_integration.md b/docs/cookbook/src/recipes/db_integration.md index eae1631..4b3d6fc 100644 --- a/docs/cookbook/src/recipes/db_integration.md +++ b/docs/cookbook/src/recipes/db_integration.md @@ -59,7 +59,7 @@ async fn main() { Extract the `State` to get access to the pool. ```rust -use rustapi::prelude::*; +use rustapi_rs::prelude::*; #[derive(Deserialize)] struct CreateUser { diff --git a/docs/cookbook/src/recipes/file_uploads.md b/docs/cookbook/src/recipes/file_uploads.md index 18504d3..2671366 100644 --- a/docs/cookbook/src/recipes/file_uploads.md +++ b/docs/cookbook/src/recipes/file_uploads.md @@ -6,7 +6,7 @@ Handling file uploads efficiently is crucial. RustAPI allows you to stream `Mult ```toml [dependencies] -rustapi = { version = "0.1.275", features = ["multipart"] } +rustapi-rs = "0.1.275" tokio = { version = "1", features = ["fs", "io-util"] } uuid = { version = "1", features = ["v4"] } ``` @@ -16,8 +16,8 @@ uuid = { version = "1", features = ["v4"] } This handler reads the incoming stream part-by-part and writes it directly to disk (or S3). ```rust -use rustapi::prelude::*; -use rustapi::extract::Multipart; +use rustapi_rs::prelude::*; +use rustapi_rs::extract::Multipart; use tokio::fs::File; use tokio::io::AsyncWriteExt; @@ -58,7 +58,7 @@ async fn upload_file(mut multipart: Multipart) -> Result { You should always set limits to prevent DoS attacks. ```rust -use rustapi::extract::DefaultBodyLimit; +use rustapi_rs::extract::DefaultBodyLimit; let app = RustApi::new() .route("/upload", post(upload_file)) diff --git a/docs/cookbook/src/recipes/websockets.md b/docs/cookbook/src/recipes/websockets.md index f46b264..48c9510 100644 --- a/docs/cookbook/src/recipes/websockets.md +++ b/docs/cookbook/src/recipes/websockets.md @@ -17,7 +17,7 @@ WebSocket connections start as HTTP requests. We "upgrade" them. ```rust use rustapi_ws::{WebSocket, WebSocketUpgrade, Message}; -use rustapi::prelude::*; +use rustapi_rs::prelude::*; use std::sync::Arc; use tokio::sync::broadcast;