Unverified Commit 6fdb67f9 authored by Alexandru Vasile's avatar Alexandru Vasile Committed by GitHub
Browse files

client: Implement `notify_on_disconnect` (#837)



* client: Implement `notify_on_disconnect`

Signed-off-by: default avatarAlexandru 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: default avatarAlexandru Vasile <[email protected]>

* Implement `InternalError` for tokio and futures_channel's SendError

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* client: Remove tokio-stream dependency

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* client: Rename `notify_on_disconnect` to `on_disconnect`

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* Add `tokio/sync` as dependency of client feature

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* wasm-client: Use `tokio::sync::mpsc::channel` for notify on disconnect

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* Add tokio/sync dependency to satisfy `--no-default-features` check

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* Best effort to close channel on client drops

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* revert to: client: Implement `notify_on_disconnect`

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* Replace tokio/sync with oneshot channel

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* tests: Check `client.on_disconnect()` returns when server shuts down

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* tests: Fix comment typo

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* tests: Call `on_disconnect()` multiple times

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* tests: Call `on_disconnect` with closed server

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

Signed-off-by: default avatarAlexandru Vasile <[email protected]>
parent 1ebaf626
Pipeline #208511 passed with stages
in 5 minutes and 26 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment