https://kotlinlang.org logo
#uniflow
Title
# uniflow
a

arnaud.giuliani

09/11/2020, 8:26 AM
Apart of that, I’m working on an issue where we have a long running action (long networking ...) and we restart the same action. Then we enqueue things, and we wait for all the actions to complete. I’m thinking to propose a way of cancelling the running action, to help restart it
e

Erik

09/11/2020, 8:30 AM
To do that I'd start a job for the long running operation, but if I need, I can cancel it. And, optionally, dispatch the same action again
a

arnaud.giuliani

09/11/2020, 8:57 AM
then you keep a local reference for the job then
e

Erik

09/11/2020, 8:58 AM
Well, you either have a reference to that job or to the action
To be able to restart the specific action
a

arnaud.giuliani

09/11/2020, 9:27 AM
how do you restart a specific action then? 🤔
we don’t have such mechanism yet
e

Erik

09/11/2020, 9:39 AM
That's what you proposed: the ability to restart an action. So, if that were possible, you'd either keep reference to the job or to the action you'd want to restart
What I mean to say is: I'm unaware of a use case for restarting an action, while we could encapsulate that behaviour in the view model by keeping reference to the job and cancelling it when needed. But there might be other use cases.
2 Views