16

I have a shiny app that allows users to upload their own data and do a few tasks. Depending on their data size and the type of tasks they would want to perform, sometimes the process gets long and even lasting forever. I would like to add the "stop" function in which users can click on it and the current task will stop and they can continue to some other tasks. How should I do it?

My second question is related to the first one. Say one of my app users has deployed a very heavy process and it has heavily occupied my CPU but the user himself has not initiated the stop signal. I would like to impose a "time out" command so that the app will be automatically terminated say after 5 minutes. How can I set it up?

Many thanks and best regards,

cloudy

cloudy
  • 183
  • 1
  • 6
  • I would also like to know how to do this. I implemented a system command that does a "pkill foo" on a process linked to a Stop button, but it did not work: the website was unresponsive... – 719016 Oct 29 '14 at 04:33

2 Answers2

1

I would create an action button that has a "Cancel" label but, will redirect to a new page when clicked on.

actionButton("button", "Cancel Operation")

In regards to the CPU stop limit, I would create a timer for that action button and when it's clicked the timer starts. Then test if a conditional statement (the time limit) has passed, redirect to a new page.

kgui
  • 4,015
  • 5
  • 41
  • 53
0

At this time, it doesn't appear as if there is answer unfortunately.

https://groups.google.com/forum/#!topic/shiny-discuss/j9-NeG9v5ds

Joe says "It's not possible right now, but last week I would've told you it would never be possible, whereas now I can think of a way to possibly implement this once we have done our next round of changes on httpuv. No promises though and in the meantime I can't think of any workaround. "

In short, no.

InfiniteFlash
  • 1,038
  • 1
  • 10
  • 22