The nautilus websocket and socket clients uses an Arc<Mutex<bool>> to syncronize between sender and receiver ends of the stream, particularly for when to disconnect. While Arc Mutex works, AtomicBool is the perfect fit for the role. ^1
Changing the type of the disconnect_mode field in websocket.rs and socket.rs should lead the type system to show all the places where changes are needed.
Enhancement Request
The nautilus websocket and socket clients uses an
Arc<Mutex<bool>>
to syncronize between sender and receiver ends of the stream, particularly for when to disconnect. While Arc Mutex works,AtomicBool
is the perfect fit for the role. ^1Changing the type of the
disconnect_mode
field inwebsocket.rs
andsocket.rs
should lead the type system to show all the places where changes are needed.