-
Notifications
You must be signed in to change notification settings - Fork 6
[FEATURE] [RPC] Implement Router and Handler Trait #40
Copy link
Copy link
Closed
Labels
coinswap-migration-phase-2The 2nd phase in integration of mill-io inside CoinswapThe 2nd phase in integration of mill-io inside CoinswapenhancementNew feature or requestNew feature or request
Description
Description
Create the routing system and handler trait that forms the core of the RPC framework.
Motivation
Allow users to register handlers for different RPC methods with type safety.
Proposed Solution
pub trait Handler: Send + Sync {
fn call(&self, req: Request) -> BoxFuture<'static, Result<Response>>;
}
pub struct Router {
routes: Map<String, Box<dyn Handler>>,
}Tasks
- Design Handler trait
- Implement Router
- Add route registration
- Support wildcard routes
- Add route conflict detection
- Write tests for routing logic
- Document routing behavior
Expected
- Type-safe handler registration
- Efficient route lookup
- Conflict detection
- Wildcard support
Dependencies:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coinswap-migration-phase-2The 2nd phase in integration of mill-io inside CoinswapThe 2nd phase in integration of mill-io inside CoinswapenhancementNew feature or requestNew feature or request