Re:Show HN: Iron, a fast middleware-oriented Rust web server...
by zzmp on Wednesday July 02, 2014 @01:19PM
(#7978201)
We have a middleware for that! You can look at http://github.com/iron/persistent, which does wrap an RWLock in an Arc. It also provides a struct to make your middleware Share, so you can do similar things.
We also have session, which works on a HashMap under an Arc, although it isolates the mutable data to a session, instead of sharing it across isolated requests.
Re:Show HN: Iron, a fast middleware-oriented Rust web server...
by eddyb on Wednesday July 02, 2014 @12:50PM
(#7978028)
I would guess `Arc<Mutex<T>>`, `Arc<RWLock<T>>` and `Arc<SomeConcurrentContainer>` would all work (cloning them is a ref-count - the handle gets copied, not the contents).
Re:Show HN: Iron, a fast middleware-oriented Rust web server...
by jonreem on Wednesday July 02, 2014 @01:18PM
(#7978194)
You are looking for https://github.com/iron/persistent, which offers two utility middleware for exactly this.
1: http://docs.ironframework.io/iron/trait.Middleware.html