Hello, I was wondering if someone can point me how to invoke threads from an action in a controller. Basically, in an action, I want to do some tasks asynchronously for which user need not wait. -- Thanks, Jaikishan --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It isn''t safe (at least not now) to create threads in Rails, but you can use something like Background Job -> http://codeforpeople.com/lib/ruby/bj/bj-1.0.1/README On Wed, Sep 24, 2008 at 8:15 AM, Jaikishan Jalan <jai.ism-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I was wondering if someone can point me how to invoke threads from an action > in a controller. Basically, in an action, I want to do some tasks > asynchronously for which user need not wait. > > -- > Thanks, > Jaikishan > > > > >-- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Will look into it. On Wed, Sep 24, 2008 at 4:49 PM, Maurício Linhares < mauricio.linhares-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > It isn''t safe (at least not now) to create threads in Rails, but you > can use something like Background Job -> > http://codeforpeople.com/lib/ruby/bj/bj-1.0.1/README > > On Wed, Sep 24, 2008 at 8:15 AM, Jaikishan Jalan <jai.ism-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Hello, > > > > I was wondering if someone can point me how to invoke threads from an > action > > in a controller. Basically, in an action, I want to do some tasks > > asynchronously for which user need not wait. > > > > -- > > Thanks, > > Jaikishan > > > > > > > > > > > > > -- > Maurício Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) > João Pessoa, PB, +55 83 8867-7208 > > > >-- Thanks, Jaikishan "Enjoying the rights of being intelligent ignorant" --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Does this background job maintains a queue sort of thing? If yes, then how does some tasks can be concurrently executed? On Wed, Sep 24, 2008 at 4:57 PM, Jaikishan Jalan <jai.ism-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Will look into it. > > > On Wed, Sep 24, 2008 at 4:49 PM, Maurício Linhares < > mauricio.linhares-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> It isn''t safe (at least not now) to create threads in Rails, but you >> can use something like Background Job -> >> http://codeforpeople.com/lib/ruby/bj/bj-1.0.1/README >> >> On Wed, Sep 24, 2008 at 8:15 AM, Jaikishan Jalan <jai.ism-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > Hello, >> > >> > I was wondering if someone can point me how to invoke threads from an >> action >> > in a controller. Basically, in an action, I want to do some tasks >> > asynchronously for which user need not wait. >> > >> > -- >> > Thanks, >> > Jaikishan >> > >> > >> > > >> > >> >> >> >> -- >> Maurício Linhares >> http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/(en) >> João Pessoa, PB, +55 83 8867-7208 >> >> >> >> > > > -- > Thanks, > Jaikishan > > "Enjoying the rights of being intelligent ignorant" >-- Thanks, Jaikishan "Enjoying the rights of being intelligent ignorant" --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Background job usually runs a job at a time, which is cool as Ruby itself is almost "single threaded", but if you want a solution with concurrent job execution, you can try SkyNet -> http://skynet.rubyforge.org/ On Wed, Sep 24, 2008 at 8:29 AM, Jaikishan Jalan <jai.ism-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Does this background job maintains a queue sort of thing? If yes, then how > does some tasks can be concurrently executed?-- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Check out the last two Railscasts. http://railscasts.com/episodes/127-rake-in-background http://railscasts.com/episodes/128-starling-and-workling I think this might be what you need. On Sep 24, 6:15 am, "Jaikishan Jalan" <jai....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I was wondering if someone can point me how to invoke threads from an action > in a controller. Basically, in an action, I want to do some tasks > asynchronously for which user need not wait. > > -- > Thanks, > Jaikishan--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I installed skynet in my rails application using
$skynet_install --rails .
After this, when I try to start my server (Mongreal), it throws me following
error.
=> Booting Mongrel (use ''script/server webrick'' to force
WEBrick)
=> Rails application starting on http://127.0.0.1:3005
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 127.0.0.1:3005
** Starting Rails with development environment...
Exiting
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'': no such file to load -- skynet (MissingSourceFile)
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
`new_constants_in''
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:318:in
`require''
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
`new_constants_in''
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:318:in
`require''
from
/home/jaikishan/aptana/plugins/org.jruby_1.1.0.5965_RC2p2/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496
... 35 levels...
from /home/jaikishan/aptana/workspace/Analytics/./script/server:3
from -e:2:in `load''
from -e:2
What to do now?
On Wed, Sep 24, 2008 at 7:34 PM, Fred
<lee.fred.1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Check out the last two Railscasts.
>
> http://railscasts.com/episodes/127-rake-in-background
>
> http://railscasts.com/episodes/128-starling-and-workling
>
> I think this might be what you need.
>
> On Sep 24, 6:15 am, "Jaikishan Jalan"
<jai....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Hello,
> >
> > I was wondering if someone can point me how to invoke threads from an
> action
> > in a controller. Basically, in an action, I want to do some tasks
> > asynchronously for which user need not wait.
> >
> > --
> > Thanks,
> > Jaikishan
> >
>
--
Thanks,
Jaikishan
"Enjoying the rights of being intelligent ignorant"
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---