client: Implement `notify_on_disconnect` (#837)
* client: Implement `notify_on_disconnect` Signed-off-by: Alexandru Vasile <[email protected]> * Revert "client: Implement `notify_on_disconnect`" This reverts commit c8ffaa4c . * client: Rely on `tokio::sync::mpsc::Sender` to notify on disconnect Signed-off-by: Alexandru Vasile <[email protected]> * Implement `InternalError` for tokio and futures_channel's SendError Signed-off-by: Alexandru Vasile <[email protected]> * client: Remove tokio-stream dependency Signed-off-by: Alexandru Vasile <[email protected]> * client: Rename `notify_on_disconnect` to `on_disconnect` Signed-off-by: Alexandru Vasile <[email protected]> * Add `tokio/sync` as dependency of client feature Signed-off-by: Alexandru Vasile <[email protected]> * wasm-client: Use `tokio::sync::mpsc::channel` for notify on disconnect Signed-off-by: Alexandru Vasile <[email protected]> * Add tokio/sync dependency to satisfy `--no-default-features` check Signed-off-by: Alexandru Vasile <[email protected]> * Best effort to close channel on client drops Signed-off-by: Alexandru Vasile <[email protected]> * revert to: client: Implement `notify_on_disconnect` Signed-off-by: Alexandru Vasile <[email protected]> * Replace tokio/sync with oneshot channel Signed-off-by: Alexandru Vasile <[email protected]> * tests: Check `client.on_disconnect()` returns when server shuts down Signed-off-by: Alexandru Vasile <[email protected]> * tests: Fix comment typo Signed-off-by: Alexandru Vasile <[email protected]> * tests: Call `on_disconnect()` multiple times Signed-off-by: Alexandru Vasile <[email protected]> * tests: Call `on_disconnect` with closed server Signed-off-by: Alexandru Vasile <[email protected]> Signed-off-by: Alexandru Vasile <[email protected]>