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 <alexandru.vasile@parity.io>

* 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 <alexandru.vasile@parity.io>

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

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* client: Remove tokio-stream dependency

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* client: Rename `notify_on_disconnect` to `on_disconnect`

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

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

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

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

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

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

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* Best effort to close channel on client drops

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* revert to: client: Implement `notify_on_disconnect`

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* Replace tokio/sync with oneshot channel

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

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

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* tests: Fix comment typo

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* tests: Call `on_disconnect()` multiple times

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* tests: Call `on_disconnect` with closed server

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
parent 1ebaf626
Pipeline #208511 passed with stages
in 5 minutes and 26 seconds
Supports Markdown
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