ruby - How to stop action execution with another action in rails? -


i have following actions in test controller:

def run   while true     # code   end end  def stop   # stop run action end 

how can stop action implemented halt run action?

because client wait response server, can't have loop in endpoint waits endpoint called.

in case, client visit /test/run, since server won't return until loop finishes, client keep waiting.

this means (unless configured webserver so), connection can't made server reach test/stop endpoint.

if must have "job" runs , cancel-able endpoint, turn actual background task.


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -