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

How do I identify which command is the WebSocket message replying to? #367

Open
ratsclub opened this issue Mar 1, 2024 · 2 comments
Open

Comments

@ratsclub
Copy link

ratsclub commented Mar 1, 2024

I'm trying to write a Deno WebSocket client for M36 but I don't understand how to identify which message is which.

Consider the scenario where you have multiple HTTP requests doing operations on the database, you would end up with multiple commands being sent from the same WebSocket connection. How can I tell the responses apart? Is there a way to send and receive a unique identifier or something else?

@agentm
Copy link
Owner

agentm commented Mar 4, 2024

Hm, the Haskell API has a SessionId precisely for this use-case but it looks like this API component was not exposed to Websockets. That's clearly an oversight, so we'll need to add this capability to the Websocket API to make this work.

The intention is to allow one Session for each parallel-capable request- Sessions are effectively bound to potential (uncommitted) transactions.

Would that address your use-case?

@ratsclub
Copy link
Author

ratsclub commented Mar 4, 2024

I think that this is exactly what we are looking after!

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