mirror of
https://github.com/logos-messaging/logos-chat.git
synced 2026-02-27 20:33:07 +00:00
chore: async stop process
This commit is contained in:
parent
09f2af49e9
commit
76e65f49b6
@ -69,7 +69,7 @@ proc main() {.async.} =
|
||||
await saro.start()
|
||||
await raya.start()
|
||||
|
||||
await sleepAsync(5.seconds)
|
||||
await sleepAsync(10.seconds)
|
||||
|
||||
# Perform OOB Introduction: Raya -> Saro
|
||||
let raya_bundle = raya.createIntroBundle()
|
||||
@ -77,8 +77,8 @@ proc main() {.async.} =
|
||||
|
||||
await sleepAsync(20.seconds) # Run for some time
|
||||
|
||||
saro.stop()
|
||||
raya.stop()
|
||||
await saro.stop()
|
||||
await raya.stop()
|
||||
|
||||
|
||||
when isMainModule:
|
||||
|
||||
@ -106,10 +106,6 @@ proc getSelectedConvo(app: ChatApp): ptr ConvoInfo =
|
||||
|
||||
proc createChatClient(name: string): Future[Client] {.async.} =
|
||||
var cfg = await getCfg(name)
|
||||
# for key, val in fetchRegistrations():
|
||||
# if key != name:
|
||||
# cfg.waku.staticPeers.add(val)
|
||||
|
||||
result = newClient(cfg.waku, cfg.ident)
|
||||
|
||||
|
||||
|
||||
@ -291,8 +291,8 @@ proc start*(client: Client) {.async.} =
|
||||
|
||||
notice "Client start complete", client = client.getId()
|
||||
|
||||
proc stop*(client: Client) =
|
||||
proc stop*(client: Client) {.async.} =
|
||||
## Stop the client.
|
||||
client.ds.stop()
|
||||
await client.ds.stop()
|
||||
client.isRunning = false
|
||||
notice "Client stopped", client = client.getId()
|
||||
|
||||
@ -206,3 +206,6 @@ proc getConnectedPeerCount*(client: WakuClient): int =
|
||||
if peerInfo.connectedness == Connected:
|
||||
inc count
|
||||
return count
|
||||
|
||||
proc stop*(client: WakuClient) {.async.} =
|
||||
await client.node.stop()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user