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

Query on Multiple http requests on single client - webdis connection #222

Open
srimithravemula opened this issue Jun 7, 2022 · 2 comments

Comments

@srimithravemula
Copy link

Hi Nicolasff,

Have a query as following -
I was trying a small test case on sending multiple http requests on same client connection to webdis. I see response in any order for the provided requests. Sample example -
for key k1 -> value v1, key k2 -> value v2
if i query like GET/k1 and GET/k2 on same client connection to webdis, i can get response v1 and response v2 or reverse order(as response v2 first and response v1).
Problem i am facing is there is no way to map between request and response in this case.
Is there any option that webdis provides to map between request and response(like example - any http header i can add to store the request?)
Or is it not expected to send multiple http requests on same connection without waiting for response?
Can you please let me know.

Thanks.

@srimithravemula
Copy link
Author

Hi Nicolasff,

Can you please let me know response to above query, when you find some time

Thanks

@nicolasff
Copy link
Owner

Hi @srimithravemula, sorry for the late reply.
There are a couple of things that you could try, those are just what comes to mind now.

One would be to write a Lua script that returns both the key and the value when given a key, so that if you call the script with k1 it return [k1, v1]v1 being the value under k1.

Another approach would be to request each one with a different (custom) Content-Type, if you can handle such replies. This feature is documented here. So you could query /GET/k1?type=k1 immediately followed by /GET/k2?type=k2. The response with Content-Type: k1 is for the first request. This is not ideal, but as a workaround I think it could help.

I hadn't considered this use case, but I agree that it's an issue. I can't really make changes to webdis at this time, so I'll see if some past contributor could look into it.

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