Is there an example to use sockpuppet for a long running job? #77
-
I'm thinking of a situation where user clicks a button and it triggers a long running job such as preparing a csv file to download And the user will see a running counter like number of seconds elapsed or number of records being written to the csv file. Once the file is ready the counter is replaced by link to download file. Or anything that's similar to the mechanics described in this scenario I have read useful patterns but I cannot fully translate what I read there into a use case like I described Happy to contribute back by writing ✍️ the use case into the official docs if I get pointers on how to make this situation work 🙏 thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @simkimsia, In short you'll need to use the Channel, initialize that with what you subscribe to in the frontend. (the default subscription that is always there is the session_key). In the example I initialized the Channel class with 'progress'. So that means that I need to create a subscription to 'progress' in the frontend to be able to see any updates. Let me know if you've got any more questions regarding this. Ping @shearichard since you seemed interested as well. |
Beta Was this translation helpful? Give feedback.
Hi @simkimsia,
I made an out of band update in #78 as an example. I hope that would give the details to adapt this into something else you would like to accomplish.
In short you'll need to use the Channel, initialize that with what you subscribe to in the frontend. (the default subscription that is always there is the session_key). In the example I initialized the Channel class with 'progress'. So that means that I need to create a subscription to 'progress' in the frontend to be able to see any updates.
Let me know if you've got any more questions regarding this. Ping @shearichard since you seemed interested as well.