From james at balvedastudios.com Tue Dec 1 05:34:54 2009 From: james at balvedastudios.com (James Harrison) Date: Tue, 01 Dec 2009 10:34:54 +0000 Subject: [Backgroundrb-devel] How to make the UNIXSocket work on Windows In-Reply-To: <404e0d6d0911302041m618db6c4n30701c98ead72ac3@mail.gmail.com> References: <404e0d6d0911302019v464ec9d0v71434570ba10e430@mail.gmail.com> <95a868280911302032y41070070lf87c001dddcd266@mail.gmail.com> <404e0d6d0911302034j1490bc60l9bb0a3d4bbeae9e4@mail.gmail.com> <404e0d6d0911302041m618db6c4n30701c98ead72ac3@mail.gmail.com> Message-ID: <4B14F14E.5040600@balvedastudios.com> Depending on what you intend to deploy on (If you're thinking of using Windows for a production environment, perhaps reconsider- everything is more difficult on Windows, including security, maintainence, updates, etc. Willing to have your production box offline for an hour each month to do Windows Update?). You can run both Apache and MySQL on Unix quite easily, without the assistance of InstantRails. They are by themselves standalone projects, and both in their element on Unix systems. There's a crapload of how-tos out there if you need to learn, and you can always get a Linux server set up in a virtualized environment to play with (I recommend Ubuntu Server or Debian Server quite highly). James Harrison On 01/12/2009 04:41, harini iyer wrote: > I forgot to add one thing which is that the application I am trying to > build the asynchronous process (a cron job) for needs instant rails to > run the apache and mysql server. I read that Unix doesnt support > InstantRails. What do i do about it? It is like, I need the best of > both the worlds :) > > Thanks for the help!! > Harini > > On Tue, Dec 1, 2009 at 10:04 AM, harini iyer wrote: > >> I have cygwin. Can you please tell me how to run this application on >> cygwin. I am using eclipse radrails(aptana). I open a command shell of >> the project and give the commands. How do I do this in cygwin? >> >> Thanks, >> Harini >> >> On Tue, Dec 1, 2009 at 10:02 AM, Justin Wood >> wrote: >> >>> I did a lot of messing around and installed cygwin and that worked. >>> >>> On Tue, Dec 1, 2009 at 5:19 PM, harini iyer wrote: >>> >>>> Hi, >>>> >>>> Win32-utils doesnt seem to have an interface for sockets. When I give the >>>> 'ruby script/backgroundrb start' , I got an error in master_packet.rb saying >>>> that UNIXSocket unimplemented. This was understood since I am working on >>>> Windows Vista. However, I tried Socket.socketpair which did not work either. >>>> Is there a workaround for this? >>>> Is there a patch available for starting the backgroundrb server on >>>> windows? I installed the win32-utils and I am still stuck on the >>>> UNIXSocket.pair() error in the packet module. >>>> >>>> Thank You, >>>> Harini >>>> >>>> _______________________________________________ >>>> Backgroundrb-devel mailing list >>>> Backgroundrb-devel at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >>>> >>> >>> >>> -- >>> Justin Wood >>> Senior Software Architect >>> >>> >>> New Zealand Office, >>> 57 Wellington Street, >>> Freemans Bay, >>> Auckland, >>> New Zealand >>> >>> >>> M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 >>> E justin.wood at trifectagis.com | Free: 0800 trifecta >>> Skype: nztrifecta >>> >>> www.trifectagis.com >>> >>> >> > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > From Adrian.Klingel at illumaware.com Tue Dec 1 11:11:09 2009 From: Adrian.Klingel at illumaware.com (Adrian Klingel) Date: Tue, 1 Dec 2009 11:11:09 -0500 Subject: [Backgroundrb-devel] Multi-threaded BackgrounDRB Message-ID: Hi, Having difficulty (detailed below) executing queued jobs for a multi- threaded worker. What controls when the jobs are actually executed? Today we're trying to multi-thread our report server. Reports are executed by a worker that basically looks like this: ######################################## class ReporterWorker < BackgrounDRb::MetaWorker set_worker_name :reporter_worker reload_on_schedule true pool_size 5 def create(args = nil) # This is called during startup end def run(arg) thread_pool.defer(:submit,arg) end def submit(arg) # report stuff here persistent_job.finish! end end ##################################### Jobs are submitted to the queue like so: MiddleMan.worker(:reporter_worker).enq_run(:arg => params,:job_key => @report.job_key) But nothing appears to be running. We used to call enq_submit directly and the job would run just fine in the background. Now I'm monitoring the db processes and I see nothing. Also,o nothing in the backgroundrb_debug log file. Looking in the rails log I can see that the rows were inserted into the queue table. Does anybody have any ideas, or any experience using multithreading with BackgrounDRB? Thanks, Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: From harini.r.iyer at gmail.com Tue Dec 1 14:13:33 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Tue, 1 Dec 2009 14:13:33 -0500 Subject: [Backgroundrb-devel] Ruby with cygwin for backgroundrb Message-ID: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> Hi, So I finally gave up trying to start the start the backgroundrb server on windows and I am trying to use Cygwin. However, I keep bumping into errors. I installed ruby (one click installer) amd rubygems0.9.3. But when i do a ruby setup.rb to install gems, it throws an error saying taht the ruby_version variable might be uninitialized . I have no idea how to proceed in order to make this backgroundrb work on cygwin. If there are any users who have made it work on cygwin, could you please tell me which version of ruby and gems are needed and how do i install them (coz apparently, i am just hitting errors all the time). Thank You, Harini From justin.wood at trifectagis.com Tue Dec 1 14:09:52 2009 From: justin.wood at trifectagis.com (Justin Wood) Date: Wed, 2 Dec 2009 08:09:52 +1300 Subject: [Backgroundrb-devel] How to make the UNIXSocket work on Windows In-Reply-To: <4B14F14E.5040600@balvedastudios.com> References: <404e0d6d0911302019v464ec9d0v71434570ba10e430@mail.gmail.com> <95a868280911302032y41070070lf87c001dddcd266@mail.gmail.com> <404e0d6d0911302034j1490bc60l9bb0a3d4bbeae9e4@mail.gmail.com> <404e0d6d0911302041m618db6c4n30701c98ead72ac3@mail.gmail.com> <4B14F14E.5040600@balvedastudios.com> Message-ID: <95a868280912011109g51d979bem21b1b351859bdcbf@mail.gmail.com> James is right there. We deploy on Linux and the ultimate hassle free solution was to move my development platform to Mac. BTW since we are throwing out suggestions of this sort ... you may find RadRails a bit buggy and unstable, Netbeans is more stable but with less features and RubyMine is just awesome; it's worthwhile checking them out. On Tue, Dec 1, 2009 at 11:34 PM, James Harrison wrote: > Depending on what you intend to deploy on (If you're thinking of using > Windows for a production environment, perhaps reconsider- everything is more > difficult on Windows, including security, maintainence, updates, etc. > Willing to have your production box offline for an hour each month to do > Windows Update?). You can run both Apache and MySQL on Unix quite easily, > without the assistance of InstantRails. They are by themselves standalone > projects, and both in their element on Unix systems. There's a crapload of > how-tos out there if you need to learn, and you can always get a Linux > server set up in a virtualized environment to play with (I recommend Ubuntu > Server or Debian Server quite highly). > > > James Harrison > > > > On 01/12/2009 04:41, harini iyer wrote: > >> I forgot to add one thing which is that the application I am trying to >> build the asynchronous process (a cron job) for needs instant rails to >> run the apache and mysql server. I read that Unix doesnt support >> InstantRails. What do i do about it? It is like, I need the best of >> both the worlds :) >> >> Thanks for the help!! >> Harini >> >> On Tue, Dec 1, 2009 at 10:04 AM, harini iyer >> wrote: >> >> >>> I have cygwin. Can you please tell me how to run this application on >>> cygwin. I am using eclipse radrails(aptana). I open a command shell of >>> the project and give the commands. How do I do this in cygwin? >>> >>> Thanks, >>> Harini >>> >>> On Tue, Dec 1, 2009 at 10:02 AM, Justin Wood >>> wrote: >>> >>> >>>> I did a lot of messing around and installed cygwin and that worked. >>>> >>>> On Tue, Dec 1, 2009 at 5:19 PM, harini iyer >>>> wrote: >>>> >>>> >>>>> Hi, >>>>> >>>>> Win32-utils doesnt seem to have an interface for sockets. When I give >>>>> the >>>>> 'ruby script/backgroundrb start' , I got an error in master_packet.rb >>>>> saying >>>>> that UNIXSocket unimplemented. This was understood since I am working >>>>> on >>>>> Windows Vista. However, I tried Socket.socketpair which did not work >>>>> either. >>>>> Is there a workaround for this? >>>>> Is there a patch available for starting the backgroundrb server on >>>>> windows? I installed the win32-utils and I am still stuck on the >>>>> UNIXSocket.pair() error in the packet module. >>>>> >>>>> Thank You, >>>>> Harini >>>>> >>>>> _______________________________________________ >>>>> Backgroundrb-devel mailing list >>>>> Backgroundrb-devel at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >>>>> >>>>> >>>> >>>> >>>> -- >>>> Justin Wood >>>> Senior Software Architect >>>> >>>> >>>> New Zealand Office, >>>> 57 Wellington Street, >>>> Freemans Bay, >>>> Auckland, >>>> New Zealand >>>> >>>> >>>> M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 >>>> E justin.wood at trifectagis.com | Free: 0800 trifecta >>>> Skype: nztrifecta >>>> >>>> www.trifectagis.com >>>> >>>> >>>> >>> >>> >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >> >> > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > -- Justin Wood Senior Software Architect New Zealand Office, 57 Wellington Street, Freemans Bay, Auckland, New Zealand M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 E justin.wood at trifectagis.com | Free: 0800 trifecta Skype: nztrifecta www.trifectagis.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin.wood at trifectagis.com Tue Dec 1 14:16:29 2009 From: justin.wood at trifectagis.com (Justin Wood) Date: Wed, 2 Dec 2009 08:16:29 +1300 Subject: [Backgroundrb-devel] Ruby with cygwin for backgroundrb In-Reply-To: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> References: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> Message-ID: <95a868280912011116p4f060ba9w8217fc4ee1bc5e69@mail.gmail.com> Treat it like a completely separate environment do gem installs and updates just like you would a new machine and that should get you there. On Wed, Dec 2, 2009 at 8:13 AM, harini iyer wrote: > Hi, > > So I finally gave up trying to start the start the backgroundrb server > on windows and I am trying to use Cygwin. However, I keep bumping into > errors. I installed ruby (one click installer) amd rubygems0.9.3. But > when i do a ruby setup.rb to install gems, it throws an error saying > taht the ruby_version variable might be uninitialized . > I have no idea how to proceed in order to make this backgroundrb work > on cygwin. > > If there are any users who have made it work on cygwin, could you > please tell me which version of ruby and gems are needed and how do i > install them (coz apparently, i am just hitting errors all the time). > > Thank You, > Harini > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > -- Justin Wood Senior Software Architect New Zealand Office, 57 Wellington Street, Freemans Bay, Auckland, New Zealand M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 E justin.wood at trifectagis.com | Free: 0800 trifecta Skype: nztrifecta www.trifectagis.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From harini.r.iyer at gmail.com Tue Dec 1 14:21:06 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Tue, 1 Dec 2009 14:21:06 -0500 Subject: [Backgroundrb-devel] Ruby with cygwin for backgroundrb In-Reply-To: <95a868280912011116p4f060ba9w8217fc4ee1bc5e69@mail.gmail.com> References: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> <95a868280912011116p4f060ba9w8217fc4ee1bc5e69@mail.gmail.com> Message-ID: <404e0d6d0912011121u38666d59lb7c1092c97afb9b6@mail.gmail.com> Thats exactly what I did. But I feel I am still going wrong somewhere. Could you please tell me which versions of Ruby adn Gems would work for cygwin? I am sure that I am making some mistake there. Thank you, Harini On Tue, Dec 1, 2009 at 2:16 PM, Justin Wood wrote: > Treat it like a completely separate environment do gem installs and updates > just like you would a new machine and that should get you there. > > On Wed, Dec 2, 2009 at 8:13 AM, harini iyer wrote: >> >> Hi, >> >> So I finally gave up trying to start the start the backgroundrb server >> on windows and I am trying to use Cygwin. However, I keep bumping into >> errors. I installed ruby (one click installer) amd rubygems0.9.3. But >> when i do a ruby setup.rb to install gems, it throws an error saying >> taht the ruby_version variable might be uninitialized . >> I have no idea how to proceed in order to make this backgroundrb work >> on cygwin. >> >> If there are any users who have made it work on cygwin, could you >> please tell me which version of ruby and gems are needed and how do i >> install them (coz apparently, i am just hitting errors all the time). >> >> Thank You, >> Harini >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > -- > Justin Wood > Senior Software Architect > > > New Zealand Office, > 57 Wellington Street, > Freemans Bay, > Auckland, > New Zealand > > > M ?+64 27 225 0749 ?| ?P ? +64 9 370 0168 ?| ?F ? +64 9 361 6504 > E ? justin.wood at trifectagis.com ?| ?Free: ? ?0800 trifecta > Skype: ?nztrifecta > > www.trifectagis.com > From justin.wood at trifectagis.com Tue Dec 1 17:41:52 2009 From: justin.wood at trifectagis.com (Justin Wood) Date: Wed, 2 Dec 2009 11:41:52 +1300 Subject: [Backgroundrb-devel] Ruby with cygwin for backgroundrb In-Reply-To: <404e0d6d0912011121u38666d59lb7c1092c97afb9b6@mail.gmail.com> References: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> <95a868280912011116p4f060ba9w8217fc4ee1bc5e69@mail.gmail.com> <404e0d6d0912011121u38666d59lb7c1092c97afb9b6@mail.gmail.com> Message-ID: <95a868280912011441q7ef89c11h9179f1801d9df876@mail.gmail.com> Can't help you there that was about 8 months ago ... the latest of everything at that point On Wed, Dec 2, 2009 at 8:21 AM, harini iyer wrote: > Thats exactly what I did. But I feel I am still going wrong somewhere. > Could you please tell me which versions of Ruby adn Gems would work > for cygwin? I am sure that I am making some mistake there. > > Thank you, > Harini > > On Tue, Dec 1, 2009 at 2:16 PM, Justin Wood > wrote: > > Treat it like a completely separate environment do gem installs and > updates > > just like you would a new machine and that should get you there. > > > > On Wed, Dec 2, 2009 at 8:13 AM, harini iyer > wrote: > >> > >> Hi, > >> > >> So I finally gave up trying to start the start the backgroundrb server > >> on windows and I am trying to use Cygwin. However, I keep bumping into > >> errors. I installed ruby (one click installer) amd rubygems0.9.3. But > >> when i do a ruby setup.rb to install gems, it throws an error saying > >> taht the ruby_version variable might be uninitialized . > >> I have no idea how to proceed in order to make this backgroundrb work > >> on cygwin. > >> > >> If there are any users who have made it work on cygwin, could you > >> please tell me which version of ruby and gems are needed and how do i > >> install them (coz apparently, i am just hitting errors all the time). > >> > >> Thank You, > >> Harini > >> _______________________________________________ > >> Backgroundrb-devel mailing list > >> Backgroundrb-devel at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > > > > > -- > > Justin Wood > > Senior Software Architect > > > > > > New Zealand Office, > > 57 Wellington Street, > > Freemans Bay, > > Auckland, > > New Zealand > > > > > > M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 > > E justin.wood at trifectagis.com | Free: 0800 trifecta > > Skype: nztrifecta > > > > www.trifectagis.com > > > -- Justin Wood Senior Software Architect New Zealand Office, 57 Wellington Street, Freemans Bay, Auckland, New Zealand M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 E justin.wood at trifectagis.com | Free: 0800 trifecta Skype: nztrifecta www.trifectagis.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From raghugada at gmail.com Thu Dec 3 03:48:41 2009 From: raghugada at gmail.com (raghavendra gada) Date: Thu, 3 Dec 2009 14:18:41 +0530 Subject: [Backgroundrb-devel] TimeZone Message-ID: <9f2cd26d0912030048t4076c33iaa6df4c9b9374959@mail.gmail.com> Hi, Whats the default time zone for the worker classes.? How to change the time zone for the wroker classes? Regards, Raghu -------------- next part -------------- An HTML attachment was scrubbed... URL: From nils at franzens.org Thu Dec 3 05:57:16 2009 From: nils at franzens.org (Nils Franzen) Date: Thu, 03 Dec 2009 11:57:16 +0100 Subject: [Backgroundrb-devel] Ruby with cygwin for backgroundrb In-Reply-To: <404e0d6d0912011121u38666d59lb7c1092c97afb9b6@mail.gmail.com> References: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> <95a868280912011116p4f060ba9w8217fc4ee1bc5e69@mail.gmail.com> <404e0d6d0912011121u38666d59lb7c1092c97afb9b6@mail.gmail.com> Message-ID: <4B17998C.9000702@franzens.org> Three years ago I had to use the cygwin ruby, never got backgroundrb working with the one-click installer ruby Best, Nils harini iyer wrote: > Thats exactly what I did. But I feel I am still going wrong somewhere. > Could you please tell me which versions of Ruby adn Gems would work > for cygwin? I am sure that I am making some mistake there. > > Thank you, > Harini > > On Tue, Dec 1, 2009 at 2:16 PM, Justin Wood wrote: > >> Treat it like a completely separate environment do gem installs and updates >> just like you would a new machine and that should get you there. >> >> On Wed, Dec 2, 2009 at 8:13 AM, harini iyer wrote: >> >>> Hi, >>> >>> So I finally gave up trying to start the start the backgroundrb server >>> on windows and I am trying to use Cygwin. However, I keep bumping into >>> errors. I installed ruby (one click installer) amd rubygems0.9.3. But >>> when i do a ruby setup.rb to install gems, it throws an error saying >>> taht the ruby_version variable might be uninitialized . >>> I have no idea how to proceed in order to make this backgroundrb work >>> on cygwin. >>> >>> If there are any users who have made it work on cygwin, could you >>> please tell me which version of ruby and gems are needed and how do i >>> install them (coz apparently, i am just hitting errors all the time). >>> >>> Thank You, >>> Harini >>> _______________________________________________ >>> Backgroundrb-devel mailing list >>> Backgroundrb-devel at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >>> >> >> -- >> Justin Wood >> Senior Software Architect >> >> >> New Zealand Office, >> 57 Wellington Street, >> Freemans Bay, >> Auckland, >> New Zealand >> >> >> M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 >> E justin.wood at trifectagis.com | Free: 0800 trifecta >> Skype: nztrifecta >> >> www.trifectagis.com >> >> > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > From adam at thewilliams.ws Thu Dec 3 08:31:35 2009 From: adam at thewilliams.ws (Adam Williams) Date: Thu, 3 Dec 2009 08:31:35 -0500 Subject: [Backgroundrb-devel] TimeZone In-Reply-To: <9f2cd26d0912030048t4076c33iaa6df4c9b9374959@mail.gmail.com> References: <9f2cd26d0912030048t4076c33iaa6df4c9b9374959@mail.gmail.com> Message-ID: <2BA8EBB2-17AC-4403-B089-A6A910576E55@thewilliams.ws> It's the same as that defined in your Rails environment.rb: config.time_zone = 'Eastern Time (US & Canada)' Or, if that is commented out, it is obtained from the system. I believe :) Adam Williams On Dec 3, 2009, at 3:48 AM, raghavendra gada wrote: > Hi, > > Whats the default time zone for the worker classes.? > How to change the time zone for the wroker classes? > > Regards, > Raghu > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel From raghugada at gmail.com Thu Dec 3 08:46:46 2009 From: raghugada at gmail.com (raghavendra gada) Date: Thu, 3 Dec 2009 19:16:46 +0530 Subject: [Backgroundrb-devel] TimeZone In-Reply-To: <2BA8EBB2-17AC-4403-B089-A6A910576E55@thewilliams.ws> References: <9f2cd26d0912030048t4076c33iaa6df4c9b9374959@mail.gmail.com> <2BA8EBB2-17AC-4403-B089-A6A910576E55@thewilliams.ws> Message-ID: <9f2cd26d0912030546w6682927cjbc81c6ff4e54508e@mail.gmail.com> Hi Adam, I am using the UTC based time in the rails environment config.time_zone = 'utc'. And only for the Worker environment i want to specify the PST time zone. Regards, Raghu On Thu, Dec 3, 2009 at 7:01 PM, Adam Williams wrote: > It's the same as that defined in your Rails environment.rb: > > config.time_zone = 'Eastern Time (US & Canada)' > > Or, if that is commented out, it is obtained from the system. > > I believe :) > > Adam Williams > > > On Dec 3, 2009, at 3:48 AM, raghavendra gada wrote: > > > Hi, > > > > Whats the default time zone for the worker classes.? > > How to change the time zone for the wroker classes? > > > > Regards, > > Raghu > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at thewilliams.ws Thu Dec 3 09:27:32 2009 From: adam at thewilliams.ws (Adam Williams) Date: Thu, 3 Dec 2009 09:27:32 -0500 Subject: [Backgroundrb-devel] TimeZone In-Reply-To: <9f2cd26d0912030546w6682927cjbc81c6ff4e54508e@mail.gmail.com> References: <9f2cd26d0912030048t4076c33iaa6df4c9b9374959@mail.gmail.com> <2BA8EBB2-17AC-4403-B089-A6A910576E55@thewilliams.ws> <9f2cd26d0912030546w6682927cjbc81c6ff4e54508e@mail.gmail.com> Message-ID: <7B49E7E0-9FAF-470A-87C0-F8EE81E95E10@thewilliams.ws> Ah, in that case, you can use: Time.use_zone('Pacific Time (US & Canada)') do ...work... end Or, you can have a different environment, like environments/backgroundrb.rb, which is a copy of environments/production.rb, except that you: config.time_zone = 'Pacific Time (US & Canada)' Of course, whatever you start backgroundrb with, you'll need to ensure that you use that environment. Could be problematic if you have other code that checks Rails.env.production?. HTH, Adam Williams On Dec 3, 2009, at 8:46 AM, raghavendra gada wrote: > Hi Adam, > > I am using the UTC based time in the rails environment > config.time_zone = 'utc'. > > And only for the Worker environment i want to specify the PST time zone. > > Regards, > Raghu > > On Thu, Dec 3, 2009 at 7:01 PM, Adam Williams wrote: > It's the same as that defined in your Rails environment.rb: > > config.time_zone = 'Eastern Time (US & Canada)' > > Or, if that is commented out, it is obtained from the system. > > I believe :) > > Adam Williams > > > On Dec 3, 2009, at 3:48 AM, raghavendra gada wrote: > > > Hi, > > > > Whats the default time zone for the worker classes.? > > How to change the time zone for the wroker classes? > > > > Regards, > > Raghu > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > From raghugada at gmail.com Fri Dec 4 00:01:57 2009 From: raghugada at gmail.com (raghavendra gada) Date: Fri, 4 Dec 2009 10:31:57 +0530 Subject: [Backgroundrb-devel] TimeZone In-Reply-To: <7B49E7E0-9FAF-470A-87C0-F8EE81E95E10@thewilliams.ws> References: <9f2cd26d0912030048t4076c33iaa6df4c9b9374959@mail.gmail.com> <2BA8EBB2-17AC-4403-B089-A6A910576E55@thewilliams.ws> <9f2cd26d0912030546w6682927cjbc81c6ff4e54508e@mail.gmail.com> <7B49E7E0-9FAF-470A-87C0-F8EE81E95E10@thewilliams.ws> Message-ID: <9f2cd26d0912032101m40bd9451l3bae73bcb0bd7dd7@mail.gmail.com> Hi Adam, Does plugin automatically checks for the environment/backgroundrb.rb or we need to make changes. Regards, Raghu On Thu, Dec 3, 2009 at 7:57 PM, Adam Williams wrote: > Ah, in that case, you can use: > > Time.use_zone('Pacific Time (US & Canada)') do > ...work... > end > > Or, you can have a different environment, like > environments/backgroundrb.rb, which is a copy of environments/production.rb, > except that you: > > config.time_zone = 'Pacific Time (US & Canada)' > > Of course, whatever you start backgroundrb with, you'll need to ensure that > you use that environment. Could be problematic if you have other code that > checks Rails.env.production?. > > HTH, > > Adam Williams > > On Dec 3, 2009, at 8:46 AM, raghavendra gada wrote: > > > Hi Adam, > > > > I am using the UTC based time in the rails environment > > config.time_zone = 'utc'. > > > > And only for the Worker environment i want to specify the PST time zone. > > > > Regards, > > Raghu > > > > On Thu, Dec 3, 2009 at 7:01 PM, Adam Williams > wrote: > > It's the same as that defined in your Rails environment.rb: > > > > config.time_zone = 'Eastern Time (US & Canada)' > > > > Or, if that is commented out, it is obtained from the system. > > > > I believe :) > > > > Adam Williams > > > > > > On Dec 3, 2009, at 3:48 AM, raghavendra gada wrote: > > > > > Hi, > > > > > > Whats the default time zone for the worker classes.? > > > How to change the time zone for the wroker classes? > > > > > > Regards, > > > Raghu > > > _______________________________________________ > > > Backgroundrb-devel mailing list > > > Backgroundrb-devel at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at thewilliams.ws Sat Dec 5 22:04:15 2009 From: adam at thewilliams.ws (Adam Williams) Date: Sat, 5 Dec 2009 22:04:15 -0500 Subject: [Backgroundrb-devel] TimeZone In-Reply-To: <9f2cd26d0912032101m40bd9451l3bae73bcb0bd7dd7@mail.gmail.com> References: <9f2cd26d0912030048t4076c33iaa6df4c9b9374959@mail.gmail.com> <2BA8EBB2-17AC-4403-B089-A6A910576E55@thewilliams.ws> <9f2cd26d0912030546w6682927cjbc81c6ff4e54508e@mail.gmail.com> <7B49E7E0-9FAF-470A-87C0-F8EE81E95E10@thewilliams.ws> <9f2cd26d0912032101m40bd9451l3bae73bcb0bd7dd7@mail.gmail.com> Message-ID: I believe that when you start the script, you need to configure the shell environment to have RAILS_ENV equal 'backgroundrb'. Again, I don't know what the implications of doing that will be, so caveat emptor! On Dec 4, 2009, at 12:01 AM, raghavendra gada wrote: > > Hi Adam, > > Does plugin automatically checks for the environment/backgroundrb.rb or > we need to make changes. > > Regards, > Raghu > > On Thu, Dec 3, 2009 at 7:57 PM, Adam Williams wrote: > Ah, in that case, you can use: > > Time.use_zone('Pacific Time (US & Canada)') do > ...work... > end > > Or, you can have a different environment, like environments/backgroundrb.rb, which is a copy of environments/production.rb, except that you: > > config.time_zone = 'Pacific Time (US & Canada)' > > Of course, whatever you start backgroundrb with, you'll need to ensure that you use that environment. Could be problematic if you have other code that checks Rails.env.production?. > > HTH, > > Adam Williams > > On Dec 3, 2009, at 8:46 AM, raghavendra gada wrote: > > > Hi Adam, > > > > I am using the UTC based time in the rails environment > > config.time_zone = 'utc'. > > > > And only for the Worker environment i want to specify the PST time zone. > > > > Regards, > > Raghu > > > > On Thu, Dec 3, 2009 at 7:01 PM, Adam Williams wrote: > > It's the same as that defined in your Rails environment.rb: > > > > config.time_zone = 'Eastern Time (US & Canada)' > > > > Or, if that is commented out, it is obtained from the system. > > > > I believe :) > > > > Adam Williams > > > > > > On Dec 3, 2009, at 3:48 AM, raghavendra gada wrote: > > > > > Hi, > > > > > > Whats the default time zone for the worker classes.? > > > How to change the time zone for the wroker classes? > > > > > > Regards, > > > Raghu > > > _______________________________________________ > > > Backgroundrb-devel mailing list > > > Backgroundrb-devel at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > > > From murugarajb at dckap.com Wed Dec 23 22:49:57 2009 From: murugarajb at dckap.com (MurugaRaj) Date: Thu, 24 Dec 2009 09:19:57 +0530 Subject: [Backgroundrb-devel] can't return array object from worker Message-ID: <4B32E4E5.8040305@dckap.com> Hello all, Subject: Not able to return object from backgroundrb worker I am trying to use xmpp4r and backgroundrb for my chat application. I am able to create a connectnion with XMPP4r through a worker in backgrounddrb. I have the problem in returning the object from the worker to my rails application. My code is as follows: class ChatWorker < BackgrounDRb::MetaWorker require 'xmpp4r' require 'xmpp4r/bytestreams' require 'xmpp4r/roster/helper/roster' require 'xmpp4r/roster/iq/roster' include Jabber Jabber::debug = true set_worker_name :chat_worker def create(args = nil) # this method is called, when worker is loaded for the first time logger.info 'Initializing Chat Worker.......' end def connect_chat(args) logger.info "Conencting chat.......#{args[:username]} --" jid = Jabber::JID.new(args[:username]) @client = Jabber::Client.new(jid) @client.connect @client.auth(args[:password]) @client.send(Jabber::Presence.new.set_show(nil).set_status('From Rails!')) logger.info "Chat Connection status - #{@client.is_connected?}" return @client.is_connected? end def connected? return @client.is_connected? end def get_buddies if self.connected? @buddy_list = [] roster = Jabber::Roster::Helper.new(@client) mainthread = Thread.current roster.add_query_callback { |iq| mainthread.wakeup } Thread.stop roster.groups.each { |group| roster.find_by_group(group).each { |item| @buddy_list << item#[{:name => item.iname, :jid => item.jid, :subscription => item.subscription}] } } logger.info "Buddies\n#{@buddy_list.inspect}" return @buddy_list end end When i call the connect_chat worker method from console i am able to connect to the server as below. MiddleMan.worker(:chat_worker).connect_chat(:arg => {:username => 'xxx at gmail.com',:password => 'xxxx'}) But when i try to call the get_buddies worker method, i am not able to get the buddy list as below. MiddleMan.worker(:chat_worker).get_buddies Even in the log file, i printed the @buddy_list object and its showing the correct result. But it is not returning the result. The problem is with result returning. Could you please help me in solving the issues. I am struggling with this for the whole day. Thank you for your any kind of suggestions. Regards Murugaraj B