Hi all, announcing that Gotham 0.3 has been released.
This is an exciting step for us, as it is the first release since the call for maintainers back in May.
https://gotham.rs/blog/release/2018/10/29/gotham-0.3.html
We look forward to any feedback or contributions 
8 Likes
Wow, that is a really well-written release announcement!
I think you do a great job of (re)introducing Gotham, with worked examples, and reasoning for why you'd want to do something in that particular way. Nice! 
Also, the improvements themselves look very neat; Great quality-of-life improvements. (especially the static-site server)
specific (small) feedback on the blogpost:
/// ...
/// Due to being shared across many worker threads, the internal counter
/// is bound inside an `Arc` (to enable sharing) and a `Mutex` (to enable
/// modification from multiple threads safely).
/// ...
#[derive(Clone, StateData)]
struct RequestCounter {
inner: Arc<Mutex<usize>>,
}
Is there a reason to use the "complicated" Arc<Mutex<>>
, instead of an AtomicUsize?
I've repeatedly seen newcomers be confused by the nested wrappers, and for this case, AtomicUsize seems to be perfect;
I guess the Arc<Mutex<>> generalizes better to user-specific adaptations, so there is something to say for it.
Other than that, the State API looks very elegant!
1 Like
Thanks for the great feedback @juleskers.
Thanks for the suggestion on the counter example - you're right - the Arc<Mutex<>>
was used to demonstrate a general wrapper for newbies to make it easier to understand how to adapt it to user-specific needs. It's a good and valid point that an AtomicUSize
would be simpler for the actual use-case though.
1 Like