syndesizer/websockets: fix connection retraction

This commit is contained in:
Emery Hemingway 2024-01-09 16:28:33 +02:00
parent 2268b75096
commit 9d0246bb1b
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# SPDX-License-Identifier: Unlicense
import std/[asyncdispatch, json]
import preserves, preserves/jsonhooks
import preserves
import syndicate, syndicate/relays
import ws
@ -20,7 +20,7 @@ proc spawnWebsocketActor*(turn: var Turn; root: Cap): Actor =
connectedHandle: Handle
newWebSocket(url).addCallback(turn) do (turn: var Turn; sock: WebSocket):
ws = sock
let connectedHandle = publish(turn, ds, initRecord("connected", url.toPreserves))
connectedHandle = publish(turn, ds, initRecord("connected", url.toPreserves))
var fut: Future[(Opcode, string)]
proc recvMessage() {.gcsafe.} =
fut = receivePacket ws