mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-07 08:03:12 +00:00
Update wording
This commit is contained in:
parent
338ecada3e
commit
e86f636725
@ -19,10 +19,11 @@ type
|
|||||||
client: RpcClient
|
client: RpcClient
|
||||||
callbacks: Table[JsonNode, SubscriptionCallback]
|
callbacks: Table[JsonNode, SubscriptionCallback]
|
||||||
methodHandlers: Table[string, MethodHandler]
|
methodHandlers: Table[string, MethodHandler]
|
||||||
# We need to keep around the filters that are used to create log filters on the RPC node
|
# Used by both PollingSubscriptions and WebsocketSubscriptions to store
|
||||||
# as there might be a time when they need to be recreated as RPC node might prune/forget
|
# subscription filters so the subscriptions can be recreated. With
|
||||||
# about them
|
# PollingSubscriptions, the RPC node might prune/forget about them, and with
|
||||||
# This is used of resubscribe all the subscriptions when using websocket with hardhat
|
# WebsocketSubscriptions, when using hardhat, subscriptions are dropped after 5
|
||||||
|
# minutes.
|
||||||
logFilters: Table[JsonNode, EventFilter]
|
logFilters: Table[JsonNode, EventFilter]
|
||||||
when defined(ws_resubscribe):
|
when defined(ws_resubscribe):
|
||||||
resubscribeFut: Future[void]
|
resubscribeFut: Future[void]
|
||||||
@ -110,10 +111,6 @@ method close*(subscriptions: JsonRpcSubscriptions) {.async: (raises: [Subscripti
|
|||||||
for id in ids:
|
for id in ids:
|
||||||
await subscriptions.unsubscribe(id)
|
await subscriptions.unsubscribe(id)
|
||||||
|
|
||||||
when defined(ws_resubscribe):
|
|
||||||
if not subscriptions.resubscribeFut.isNil:
|
|
||||||
await subscriptions.resubscribeFut.cancelAndWait()
|
|
||||||
|
|
||||||
proc getCallback(subscriptions: JsonRpcSubscriptions,
|
proc getCallback(subscriptions: JsonRpcSubscriptions,
|
||||||
id: JsonNode): ?SubscriptionCallback {. raises:[].} =
|
id: JsonNode): ?SubscriptionCallback {. raises:[].} =
|
||||||
try:
|
try:
|
||||||
@ -189,6 +186,11 @@ method unsubscribe*(subscriptions: WebSocketSubscriptions,
|
|||||||
# Ignore if uninstallation of the subscribiton fails.
|
# Ignore if uninstallation of the subscribiton fails.
|
||||||
discard
|
discard
|
||||||
|
|
||||||
|
method close*(subscriptions: WebsocketSubscriptions) {.async.} =
|
||||||
|
await procCall JsonRpcSubscriptions(subscriptions).close()
|
||||||
|
if not subscriptions.resubscribeFut.isNil:
|
||||||
|
await subscriptions.resubscribeFut.cancelAndWait()
|
||||||
|
|
||||||
# Polling
|
# Polling
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user