From hosh at isshen.com Wed Aug 1 08:38:33 2007 From: hosh at isshen.com (Ho-Sheng Hsiao) Date: Wed, 01 Aug 2007 07:38:33 -0500 Subject: [ap4r-user] Getting started Message-ID: <46B07EC9.1020607@isshen.com> Hi all I really like the way this project is setup. However, it seems that 0.3.2 needs some polishing. So I'll send out these email as I go along -- hopefully, no one will think I am spamming. There's very sparse documentation ... The first thing is what ap4r_setup does when it applies the scripts. mongrel_ap4r does not have #!/usr/bin/env ruby Maybe I am missing something, though, since there's that loop.rb and loop.cmd (possible to keep mongre_ap4r running?). None of the scripts are chmod a+x when created ... it doesn't matter on Windows, but since I use Linux, it makes a difference. I also have a question: if I do something such as Feed.find_all_published.each do |feed| async_to(:controller => 'cron', :action => 'process_feed', :id => feed.id ) end I assume that all of this gets queued, and the number of threads that run concurrently depend on what is in the configuration file. If this is not the case, please clarify. My plans are to get this working for what will be on a production environment. I was asked to write some large modifications to Typo ... some of the processes require offloading onto background processes. I was going to use BackgroundRB until I stumbled across this package. I particularly liked the idea of making an asynchronous callback via Apache/mongrel. ... unfortunately, the only documentation I have of async_to! is in those slides. Ho-Sheng Hsiao Isshen, LLC From hosh at isshen.com Wed Aug 1 14:10:59 2007 From: hosh at isshen.com (Ho-Sheng Hsiao) Date: Wed, 01 Aug 2007 13:10:59 -0500 Subject: [ap4r-user] Getting started In-Reply-To: <46B07EC9.1020607@isshen.com> References: <46B07EC9.1020607@isshen.com> Message-ID: <46B0CCB3.2020807@isshen.com> Ok, this has me stumped. What's up with this? HelloWorld has the same problem. Why would it be complaining about ri ?? $ script/server => Booting Mongrel (use 'script/server webrick' to force WEBrick) server: invalid option: --trace => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Ruby version is not up-to-date; loading cgi_multipart_eof_fix ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... allow_concurrency=false SitealizerController: missing default helper path sitealizer_helper Exiting /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant RI::Paths (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in `const_missing' from /usr/lib/ruby/1.8/rdoc/ri/ri_options.rb:53 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require' from /usr/lib/ruby/1.8/rdoc/usage.rb:72 ... 66 levels... from /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from script/server:3 Ho-Sheng Hsiao Isshen, LLC From dave at interactivemediums.com Wed Aug 1 15:22:20 2007 From: dave at interactivemediums.com (Dave Farkas) Date: Wed, 01 Aug 2007 14:22:20 -0500 Subject: [ap4r-user] Getting started In-Reply-To: <46B0CCB3.2020807@isshen.com> References: <46B07EC9.1020607@isshen.com> <46B0CCB3.2020807@isshen.com> Message-ID: <46B0DD6C.2010200@interactivemediums.com> What version of ruby are you using (ruby -v)? I had a similar problem when using 1.8.5. Patchlevel 12 fixed the problem. You can see some details at http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=5563 Dave Ho-Sheng Hsiao wrote: > Ok, this has me stumped. What's up with this? > > HelloWorld has the same problem. Why would it be complaining about ri ?? > > $ script/server > => Booting Mongrel (use 'script/server webrick' to force WEBrick) > server: invalid option: --trace > => Rails application starting on http://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > ** Ruby version is not up-to-date; loading cgi_multipart_eof_fix > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > allow_concurrency=false > SitealizerController: missing default helper path sitealizer_helper > Exiting > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:263:in > `load_missing_constant': uninitialized constant RI::Paths (NameError) > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in > `const_missing' > from /usr/lib/ruby/1.8/rdoc/ri/ri_options.rb:53 > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require' > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in > `require' > from /usr/lib/ruby/1.8/rdoc/usage.rb:72 > ... 66 levels... > from > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require' > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from script/server:3 > > > Ho-Sheng Hsiao > Isshen, LLC > _______________________________________________ > ap4r-user mailing list > ap4r-user at rubyforge.org > http://rubyforge.org/mailman/listinfo/ap4r-user > > From shinohara.shunichi at future.co.jp Wed Aug 1 21:06:06 2007 From: shinohara.shunichi at future.co.jp (shinohara.shunichi at future.co.jp) Date: Thu, 2 Aug 2007 10:06:06 +0900 Subject: [ap4r-user] Getting started In-Reply-To: <46B07EC9.1020607@isshen.com> References: <46B07EC9.1020607@isshen.com> Message-ID: <14CE73B79D552644B7CBEF0428763DF602E2DC12@045MAIL.future.co.jp> Hi Ho-Sheng, > The first thing is what ap4r_setup does when it applies the scripts. Thank you for your feedback! > mongrel_ap4r does not have #!/usr/bin/env ruby > > Maybe I am missing something, though, since there's that loop.rb and > loop.cmd (possible to keep mongre_ap4r running?). loop.* files are used only in my development time. It doesn't need to exists in users' directory generated by ap4r_setup. Sorry for that. > None of the scripts are chmod a+x when created ... it doesn't > matter on > Windows, but since I use Linux, it makes a difference. Add this to my list. > I assume that all of this gets queued, and the number of threads that > run concurrently depend on what is in the configuration file. > If this is not the case, please clarify. You are right :-) > environment. I was asked to write some large modifications to Typo ... > some of the processes require offloading onto background processes. I Does Typo means blog application using Rails? I think that offloading of web applications is very idea and good usecase of AP4R. If you don't mind, please let me know more about the plan. > ... unfortunately, the only documentation I have of async_to! is in > those slides. I apologize for poor documentation. There are some docs, maybe you know, Wiki http://ap4r.rubyforge.org/wiki/wiki.pl (rather poor :-<) and RDoc http://ap4r.rubyforge.org/doc/ . Would you please let me know what kind of doc you need? Best regards, shino From sava.chankov at gmail.com Thu Aug 23 12:30:48 2007 From: sava.chankov at gmail.com (Sava Chankov) Date: Thu, 23 Aug 2007 19:30:48 +0300 Subject: [ap4r-user] Number of files in file based queues Message-ID: <8834b7bc0708230930w19a734c5ieb3ee0324a2789f@mail.gmail.com> Hi, I'm giving ap4r a try. My Rails project runs with PostgreSQL and it doesn't need store-and-forward messages, so I'm using file based queue. I noticed that after dispatching the request the queue file remains. Well, it could be quite a problem if the number of files in the queue directory reaches the file system limit. Is it safe to remove older files periodically in a cron job? Or better, is there a way to tell the ap4r dispatcher to remove the queue file after successfully sending the message? cheers and keep the good work, Sava Chankov -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ap4r-user/attachments/20070823/cc14da2d/attachment.html From shino.shun at gmail.com Fri Aug 24 09:10:34 2007 From: shino.shun at gmail.com (shun shino) Date: Fri, 24 Aug 2007 22:10:34 +0900 Subject: [ap4r-user] Number of files in file based queues In-Reply-To: <8834b7bc0708230930w19a734c5ieb3ee0324a2789f@mail.gmail.com> References: <8834b7bc0708230930w19a734c5ieb3ee0324a2789f@mail.gmail.com> Message-ID: <6af2b9b80708240610w2d967a10t4144aca0643f7c24@mail.gmail.com> Hi Sava, Thank you for your interests on AP4R! > I'm giving ap4r a try. My Rails project runs with PostgreSQL and it doesn't We will add PostgreSQL support for message store in near future. It is in SVN's trunk but experimental yet. > that after dispatching the request the queue file remains. The reliable-msg's disk store keeps up to 20 file handles to avoid frequent file creations and deletions. So there may be (20 + active messages count) files. > directory reaches the file system limit. Is it safe to remove older files > periodically in a cron job? Or better, is there a way to tell the ap4r If you have confirmation that there is no active message in queues and AP4R process is stopped, you can remove all files in queues directory. It causes no problem. If there is other questions or feed backs, please tell me! Best Regards, shino From sava.chankov at gmail.com Wed Aug 29 11:54:47 2007 From: sava.chankov at gmail.com (Sava Chankov) Date: Wed, 29 Aug 2007 18:54:47 +0300 Subject: [ap4r-user] Automatic start of ap4r server on init, logs? Message-ID: <8834b7bc0708290854s38484c77sf6728e453da14184@mail.gmail.com> Hi, I'm trying to write init script for ap4r server on CentOS. However, I can't figure out which script in script/ dir to call. None of them seems to start a daemon. And how to configure logging so that logs are in log/ dir? cheers, Sava -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ap4r-user/attachments/20070829/37cdc6bc/attachment.html From sava.chankov at gmail.com Wed Aug 29 12:05:36 2007 From: sava.chankov at gmail.com (Sava Chankov) Date: Wed, 29 Aug 2007 19:05:36 +0300 Subject: [ap4r-user] Automatic start of ap4r server on init, logs? In-Reply-To: <8834b7bc0708290854s38484c77sf6728e453da14184@mail.gmail.com> References: <8834b7bc0708290854s38484c77sf6728e453da14184@mail.gmail.com> Message-ID: <8834b7bc0708290905p37bcedbdg55ce8591411a2340@mail.gmail.com> On 29/08/2007, Sava Chankov wrote: > > Hi, > I'm trying to write init script for ap4r server on CentOS. However, I > can't figure out which script in script/ dir to call. None of them seems to > start a daemon. And how to configure logging so that logs are in log/ dir? Ops, it turned to be quite obvious: ruby script/mongrel_ap4r start -d sorry for the noise, Sava -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ap4r-user/attachments/20070829/65052e70/attachment.html From shino.shun at gmail.com Thu Aug 30 08:53:39 2007 From: shino.shun at gmail.com (shun shino) Date: Thu, 30 Aug 2007 21:53:39 +0900 Subject: [ap4r-user] Automatic start of ap4r server on init, logs? In-Reply-To: <8834b7bc0708290905p37bcedbdg55ce8591411a2340@mail.gmail.com> References: <8834b7bc0708290854s38484c77sf6728e453da14184@mail.gmail.com> <8834b7bc0708290905p37bcedbdg55ce8591411a2340@mail.gmail.com> Message-ID: <6af2b9b80708300553y65b26081uc8ed586c5551aa08@mail.gmail.com> Hi Sava, 2007/8/30, Sava Chankov : > sorry for the noise, No problem! :-) There are, I think you already know, some sub-commands in mongrel_ap4r. % ruby script/mongrel_ap4r help shows commands. Also each command describes options with option "-h". Best regards, shino