-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Description
- Julia 1.8.2
- HTTP.jl 1.5.1
- MbedTLS.jl 1.1.7
Hello everyone,
I am building a package to connect to a websocket service.
Here is my understanding of the WebSockets API, the handler function is what the end user would pass to get callbacks.
function open(handler::Function)
WebSockets.open(WEBSOCKETS_URL) do ws
global webSocket[] = ws
while true
response = receive(ws)
handler(JSON3.read(response, Response))
end
end
end
function close()
WebSockets.close(webSocket[])
endthe while true feels really bad I have to say. Isn't there an async API to provide HTTP.WebSockets with callbacks directly?
Love your feedback, just starting out in julia.
Best!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels