Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websockets output change #1047

Closed
Robert-j7 opened this issue May 13, 2023 · 6 comments
Closed

Websockets output change #1047

Robert-j7 opened this issue May 13, 2023 · 6 comments

Comments

@Robert-j7
Copy link

Does the WebSockets.open returns an abstract type? Is it documented?

@quinnj
Copy link
Member

quinnj commented May 15, 2023

Can you clarify your issue/question here? In Julia, objects always have concrete types (unlike Java). Perhaps you're wondering what the set of possible types are that can be returned/expected?

@Robert-j7
Copy link
Author

Robert-j7 commented May 15, 2023

Yeah, I was wondering about HTTP.WebSockets.WebSocket which returns the fields defined below. Before, we would have gotten only the :readbuffer part when you were receiving data from a websocket as strings.

(:id, :io, :request, :response, :maxframesize, :maxfragmentation, :client, :re adbuffer, :writebuffer, :readclosed, :writeclosed)

@quinnj
Copy link
Member

quinnj commented May 15, 2023

I still don't understand the question/issue; can you rephrase perhaps?

@Robert-j7
Copy link
Author

Robert-j7 commented May 15, 2023

This is weird! For debugging I just use println to see what's happening like this:

WebSockets.open("wss://fstream.binance.com/stream?streams=btcusdt@depth") do ws
        for msg in ws
               println(msg)
        end
end

And it would print alright. After that I push the data I want to a database, now two days ago I just send the incoming data to an empty array like this:

WebSockets.open("wss://fstream.binance.com/stream?streams=btcusdt@depth") do ws
        for msg in ws
               push!(array, msg)
        end
end

when I did this it would just send :id :io :maxframesize... but not the data itself that should be inside :readbuffer. So I just put msg.readbuffer instead of msg and it worked. So I thought there were changes to the WebSockets output type. I tried today again, everything is back to normal, no need for the msg.readbuffer, it just sends the incoming data into the array!

@Robert-j7
Copy link
Author

To add, the issue I encountered was 1.9.2, and the issue was gone in 1.9.4, both Julia 1.9. Unfortunately I didn't log the problematic output. If you think it is not that important, I will just close this issue.

@quinnj
Copy link
Member

quinnj commented May 15, 2023

Yeah, there was a bug in the 1.9.2/1.9.3 releases that was fixed in the 1.9.4 release.

@quinnj quinnj closed this as completed May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants