-
Notifications
You must be signed in to change notification settings - Fork 2
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
⚠️ This does not handle unbuffered cases. #3
Comments
@ohsayan Do you have a reproducible statement? I don't understand the specific problem situation. |
@jkcs the current For slightly larger responses, this will not be the case and the function will return an error. If you see the Rust driver for example, it checks if sufficient data is buffered by the socket in a loop and if not, it continues to wait for more data. |
@ohsayan In other words, when I send a query, is it possible for the Skytable server to respond multiple times? |
The server doesn't "respond multiple times" -- it only responds once! But the response when large enough will take longer to be transported over the network. So essentially when you do a read syscall all the data might not have been sent and you'll have to wait for all of it to reach you. That's how it works for all servers -- even your HTTP responses are read in a loop under the hood! |
The easiest way to understand it is like this — imagine you’re sending over a 5GB file; you will never receive all of it at once and hence you’ll keep polling to see if you received any new data and then update your local file accordingly. Also, there is no end of transmission signal because of binary data (since a last byte can easily coincide with a signal — and unnecessarily complex logic would have to be added for a end of transmission block). In a way, Skyhash is kind of like a streaming protocol. |
I see where the problem lies, and I'm envisioning a solution. |
You can take a look at what the Rust driver does. I already have a somewhat draft implementation for the NodeJS client. |
I can provide a pull request draft later. |
Yeah, that's what I did with the Rust implementation. A similar approach would be plausible |
Originally posted by @ohsayan in #2 (comment)
The text was updated successfully, but these errors were encountered: