hit-box / hitbox

A high-performance caching framework suitable for single-machine and for distributed applications in Rust
MIT License
73 stars 6 forks source link

Add base actix-web integration #18

Open singulared opened 3 years ago

singulared commented 3 years ago

For integration with actix-web we need to implement trait Cacheable for HttpRequest and add some service\route declaration helper functions. Something like this:

HttpServer::new(|| {
    App::new()
        .service(web::resource("/something")
            .route(web:get().to(get_something))
            .cache(ttl=60))
})