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
Post a Comment