I am writing some app which involves execution of external bin/ script. How do i run it with RoR apps ? Currently, i thought of using `custom_script agr1 arg2` in my controller/model . Is it good ? Or you handle it in some other way ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Dec 23, 2012, at 2:24 AM, Paritosh P. wrote:> Currently, i thought of using > `custom_script agr1 arg2` > in my controller/model . Is it good ? Or you handle it in some other > way ?Depends on awful lot on the script itself. It''s not necessarily a bad idea, but... For instance, how long will the script take to run? Is it OK to tie up a worker process waiting on it? Does the user expect to see the result/confirmation of the script''s action right away? Does the user only need to see the final result, or do they need updates/info on its progress? Depending on the particulars, it *might* be better to push the request on a queue, and have another process executing those requests in the background. There are utilities for this... -- Scott Ribe scott_ribe-ZCQMRMivIIdUL8GK/JU1Wg@public.gmane.org http://www.elevated-dev.com/ (303) 722-0567 voice -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Scott Ribe wrote in post #1090011:> On Dec 23, 2012, at 2:24 AM, Paritosh P. wrote: > >> Currently, i thought of using >> `custom_script agr1 arg2` >> in my controller/model . Is it good ? Or you handle it in some other >> way ? > > Depends on awful lot on the script itself. It''s not necessarily a bad > idea, but... > > For instance, how long will the script take to run? Is it OK to tie up a > worker process waiting on it? Does the user expect to see the > result/confirmation of the script''s action right away? Does the user > only need to see the final result, or do they need updates/info on its > progress? > > Depending on the particulars, it *might* be better to push the request > on a queue, and have another process executing those requests in the > background. There are utilities for this... > > -- > Scott Ribe > scott_ribe-ZCQMRMivIIdUL8GK/JU1Wg@public.gmane.org > http://www.elevated-dev.com/ > (303) 722-0567 voiceThanks scott . I will keep this thing in mind .may be i will use deplayedjob or something like that . My motive is to start some script , it will take hour to finish. In this meantime, a user can also start same process again with different entity or cancel/resume ongoing processes . -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
.>> Thanks scott . I will keep this thing in mind .may be i will use > deplayedjob or something like that . My motive is to start some script , > it will take hour to finish. In this meantime, a user can also start > same process again with different entity or cancel/resume ongoing > processes . >If it takes an hour to run you could very easily run out of delayed job processes. In addition to using something like childprocess to control your child processes, you might want to try if you could write a single master process that could use select to multiplex io from all of the child processes. Fred> -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Frederick Cheung wrote in post #1090089:> . >> > >> Thanks scott . I will keep this thing in mind .may be i will use >> deplayedjob or something like that . My motive is to start some script , >> it will take hour to finish. In this meantime, a user can also start >> same process again with different entity or cancel/resume ongoing >> processes . >> > > If it takes an hour to run you could very easily run out of delayed > job processes. In addition to using something like childprocess to > control your child processes, you might want to try if you could write > a single master process that could use select to multiplex io from all > of the child processes. > > Fredis it possible to manage processes with rails ? dont say with system command,something more exclusive ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.