Closed flosse closed 7 years ago
https://github.com/tokio-rs/tokio-service/issues/9#issuecomment-269105545
Services are intended to be pure functions of request -> future of a response. If you want to track some state, you should use some sort of cell managing internal mutability. Service values are also intended to be Sync
... (or at least will work better if they are).
Thank you for that clarification!
Is there a reason for why the
Service
trait does not use a mutable reference toself
? https://github.com/tokio-rs/tokio-service/blob/c56afde938abbbccb6db257a49adddf5ad174374/src/lib.rs#L157Let's say I'd like to modify a client struct: