-
Notifications
You must be signed in to change notification settings - Fork 12
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
RPC with status updates? #11
Comments
Hi @joelkuiper , I can try to show how it could be done in clj-wamp... https://gist.github.com/cgmartin/6302379 Here's a simple WAMP server with a long running RPC call. In the client, a button click will start a WAMP websocket connection. Immediately upon open it will subscribe to the status PubSub channel and issue the long running RPC call. A PubSub event listener On completion of the RPC call, the client closes the WAMP connection and the button listener is set again. This may or may not fit with your current design, but I hope it illustrates one way it could be done in WAMP-land. (Note: the gist is based off of code in the unreleased release-1.1 branch) |
One edit/enhancement to the server PubSub events can target specific clients using |
Ah yes, that's perfect! I think I'll play around with that later today. I'll probably end up doing both this and a RESTful API. Have the relevant changes been deployed as a 1.1-SNAPSHOT or should I do a manual install first? Many thanks 😄 ! |
Glad to hear! I redeployed You'd only need 1.1.0-SNAPSHOT if you're interested in using the ClojureScript WAMP client. The WAMP server should work fine with a similar AutobahnJS client in the current 1.0.0 release if you're wary of the snapshot version. I hope to release 1.1.0 in the next week or so. It's feature complete, just alpha testing at the moment. Cheers |
Bit of a question, actually.
I have a service that handles long running tasks with progress reporting. Currently this works as follows: a user submits a task through POST which immediately returns a reply (in JSON) which includes a link to a web sockets url where the user can listen for updates (out of band). When the task is done the results are simply merged in with the status and pushed as a (last) status update. The client checks the JSON for the status and resolves a results future if there are results (or rejects if the task failed).
I'm looking to simplify this a bit and WAMP seems nice, however there does not seem to be an obvious way to send status updates for an RPC. Now I could just swap out the POST for a WS RPC (so that it returns a link to the status updates immediately) but it seems less than ideal. What would be your take on this?
The text was updated successfully, but these errors were encountered: