mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-29 21:41:03 +00:00
LightClient: Unsubscribe from subscriptions (#1408)
* lightclient: Refactor the background protocol to receive unsub method Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * light-client: Unsubscribe if the user dropped the subscription Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Refactor background task for borrow-checker Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient/rpc: Pass the unsub method name to the background task Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Unsubscribe with subscription ID as param Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * lightclient: Rename subscription states Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -179,6 +179,7 @@ impl LightClientRpc {
|
||||
&self,
|
||||
method: String,
|
||||
params: String,
|
||||
unsubscribe_method: String,
|
||||
) -> Result<
|
||||
(
|
||||
oneshot::Receiver<MethodResponse>,
|
||||
@@ -191,6 +192,7 @@ impl LightClientRpc {
|
||||
|
||||
self.to_backend.send(FromSubxt::Subscription {
|
||||
method,
|
||||
unsubscribe_method,
|
||||
params,
|
||||
sub_id,
|
||||
sender,
|
||||
|
||||
Reference in New Issue
Block a user