<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ruby Background Tasks with Starling</title>
	<atom:link href="http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/feed/" rel="self" type="application/rss+xml" />
	<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/</link>
	<description>Some random thoughts - Go big or stay home!</description>
	<lastBuildDate>Wed, 10 Mar 2010 03:16:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-736</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sun, 07 Feb 2010 00:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-736</guid>
		<description>Doh! I did the same thing. I always forget about script/server being different from script/console.</description>
		<content:encoded><![CDATA[<p>Doh! I did the same thing. I always forget about script/server being different from script/console.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-735</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Sat, 06 Feb 2010 23:50:56 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-735</guid>
		<description>Oh, I&#039;m an idiot.  Apparently starting a rails environment is now: 

script/server -e environment_name

and NOT: 

script/server RAILS_ENV=environment_name</description>
		<content:encoded><![CDATA[<p>Oh, I&#8217;m an idiot.  Apparently starting a rails environment is now: </p>
<p>script/server -e environment_name</p>
<p>and NOT: </p>
<p>script/server RAILS_ENV=environment_name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-734</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sat, 06 Feb 2010 21:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-734</guid>
		<description>Try:
RAILS_ENV=development_remote script/server

If it&#039;s dropping back to development, it could be that it&#039;s not properly picking up the RAILS_ENV.</description>
		<content:encoded><![CDATA[<p>Try:<br />
RAILS_ENV=development_remote script/server</p>
<p>If it&#8217;s dropping back to development, it could be that it&#8217;s not properly picking up the RAILS_ENV.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-733</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Sat, 06 Feb 2010 20:48:25 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-733</guid>
		<description>Howdy,

So I have this in 

## config/workling.yml:
production:
  listens_on: localhost:15151

development:
  listens_on: localhost:22322
  
test:
  listens_on: localhost:12345
  
development_remote:
    listens_on: #my_remote_ip_here#:22522
    
cucumber:
    listens_on: localhost:12345

## end of config/workling.yml

I get the starling and workling set up on my staging server at #remote_ip#, and I get this outcome:

# this succeeds:
script/console development_remote
&gt;&gt; r = MyWorkerClass.asynch_count_to_a_hundred_million
=&gt; &quot;&quot;my_worker_classes:count_to_a_hundred_million:7edb0e25b721ea725441b79d8ebb4d58&quot;

# and it goes to the queue, and I see the processor spike as ruby counts to 100,000,000 on my staging server

... all good so far, but then

## this fails:
script/server RAILS_ENV=development_remote
# when I browse to a controller function which somewhere has 
# MyWorkerClass.asynch_count_to_a_hundred_million
# I get the following error: 
&quot;config/workling.yml configured to connect to queue server on localhost:22322 for this environment. could not connect to queue server on this host:port. for starling users: pass starling the port with -p flag when starting it. If you don&#039;t want to use Starling, then explicitly set Workling::Remote.dispatcher (see README for an example)&quot;

So it looks like it&#039;s not loading the proper set of details from workling.yml.  How can I fix this?

Thanks
 - Luke</description>
		<content:encoded><![CDATA[<p>Howdy,</p>
<p>So I have this in </p>
<p>## config/workling.yml:<br />
production:<br />
  listens_on: localhost:15151</p>
<p>development:<br />
  listens_on: localhost:22322</p>
<p>test:<br />
  listens_on: localhost:12345</p>
<p>development_remote:<br />
    listens_on: #my_remote_ip_here#:22522</p>
<p>cucumber:<br />
    listens_on: localhost:12345</p>
<p>## end of config/workling.yml</p>
<p>I get the starling and workling set up on my staging server at #remote_ip#, and I get this outcome:</p>
<p># this succeeds:<br />
script/console development_remote<br />
&gt;&gt; r = MyWorkerClass.asynch_count_to_a_hundred_million<br />
=&gt; &#8220;&#8221;my_worker_classes:count_to_a_hundred_million:7edb0e25b721ea725441b79d8ebb4d58&#8243;</p>
<p># and it goes to the queue, and I see the processor spike as ruby counts to 100,000,000 on my staging server</p>
<p>&#8230; all good so far, but then</p>
<p>## this fails:<br />
script/server RAILS_ENV=development_remote<br />
# when I browse to a controller function which somewhere has<br />
# MyWorkerClass.asynch_count_to_a_hundred_million<br />
# I get the following error:<br />
&#8220;config/workling.yml configured to connect to queue server on localhost:22322 for this environment. could not connect to queue server on this host:port. for starling users: pass starling the port with -p flag when starting it. If you don&#8217;t want to use Starling, then explicitly set Workling::Remote.dispatcher (see README for an example)&#8221;</p>
<p>So it looks like it&#8217;s not loading the proper set of details from workling.yml.  How can I fix this?</p>
<p>Thanks<br />
 &#8211; Luke</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-722</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Wed, 23 Dec 2009 21:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-722</guid>
		<description>Using -q is the only thing I can suggest. The problem is that I&#039;m not sure Starling even works on Windows. I know it hasn&#039;t been tested much.

See this:
http://groups.google.com/group/starlingmq/browse_thread/thread/beedc7a6d7c84bd1/feda55233fa355ff?lnk=gst&amp;q=windows#feda55233fa355ff

Seth knows his stuff.</description>
		<content:encoded><![CDATA[<p>Using -q is the only thing I can suggest. The problem is that I&#8217;m not sure Starling even works on Windows. I know it hasn&#8217;t been tested much.</p>
<p>See this:<br />
<a href="http://groups.google.com/group/starlingmq/browse_thread/thread/beedc7a6d7c84bd1/feda55233fa355ff?lnk=gst&#038;q=windows#feda55233fa355ff" rel="nofollow">http://groups.google.com/group/starlingmq/browse_thread/thread/beedc7a6d7c84bd1/feda55233fa355ff?lnk=gst&#038;q=windows#feda55233fa355ff</a></p>
<p>Seth knows his stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anooj</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-721</link>
		<dc:creator>Anooj</dc:creator>
		<pubDate>Wed, 23 Dec 2009 19:52:46 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-721</guid>
		<description>Hi Dave,

I am working on getting starling/workling combo setup for my app when I ran into a this problem. I am using a Windows machine for development and linux machines host my deployments. When I start starling and set a queue to something on the dev machine, starling gives me an error because the path it creates automatically for my queue( /var/spool/starling/.. ) has a &#039;/&#039; instead of a &#039;\&#039;. I tried setting the path explicitly when starting starling using:

starling -d -q C:\..\..

But still its doing the same thing. Anything I can do to get this to do the right thing??

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>I am working on getting starling/workling combo setup for my app when I ran into a this problem. I am using a Windows machine for development and linux machines host my deployments. When I start starling and set a queue to something on the dev machine, starling gives me an error because the path it creates automatically for my queue( /var/spool/starling/.. ) has a &#8216;/&#8217; instead of a &#8216;\&#8217;. I tried setting the path explicitly when starting starling using:</p>
<p>starling -d -q C:\..\..</p>
<p>But still its doing the same thing. Anything I can do to get this to do the right thing??</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-720</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 21 Dec 2009 16:10:41 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-720</guid>
		<description>To terminate a queue with extreme prejudice, you can stop starling and delete the queue file. By default, the queue files are in /var/spool/starling. The filename will equal the name of the queue.

BTW, these files are how the memory queue is rebuilt when you restart starling.</description>
		<content:encoded><![CDATA[<p>To terminate a queue with extreme prejudice, you can stop starling and delete the queue file. By default, the queue files are in /var/spool/starling. The filename will equal the name of the queue.</p>
<p>BTW, these files are how the memory queue is rebuilt when you restart starling.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jackson Blacklock</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-719</link>
		<dc:creator>Jackson Blacklock</dc:creator>
		<pubDate>Mon, 21 Dec 2009 08:12:28 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-719</guid>
		<description>Hello,

I am trying to delete the starling queues:

&lt;b&gt;./script/console&lt;/b&gt;

&gt;&gt; starling.available_queues
=&gt; [&quot;vimeo_background_upload_workers__upload_to_vimeo&quot;, &quot;queue_paperclip_background_upload_workers_upload_to_amazon_s3&quot;, &quot;queue_paperclip_background_upload_workers__upload_to_amazon_s3&quot;, &quot;paperclip_background_upload_workers__upload_to_amazon_s3&quot;]

&gt;&gt;starling.delete(&#039;queue_paperclip_background_upload_workers_upload_to_amazon_s3&#039;)
MemCache::MemCacheError: bad command line format

Is there another way to delete the queue item?  I have a pretty nasty back log that is starting to eat up my memory.  If I kill the PID and restart the worker it seems to cache the queue and restarts everything.

Any help would be greatly appreciated!

Best,

Jackson</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I am trying to delete the starling queues:</p>
<p><b>./script/console</b></p>
<p>&gt;&gt; starling.available_queues<br />
=&gt; ["vimeo_background_upload_workers__upload_to_vimeo", "queue_paperclip_background_upload_workers_upload_to_amazon_s3", "queue_paperclip_background_upload_workers__upload_to_amazon_s3", "paperclip_background_upload_workers__upload_to_amazon_s3"]</p>
<p>&gt;&gt;starling.delete(&#8216;queue_paperclip_background_upload_workers_upload_to_amazon_s3&#8242;)<br />
MemCache::MemCacheError: bad command line format</p>
<p>Is there another way to delete the queue item?  I have a pretty nasty back log that is starting to eat up my memory.  If I kill the PID and restart the worker it seems to cache the queue and restarts everything.</p>
<p>Any help would be greatly appreciated!</p>
<p>Best,</p>
<p>Jackson</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-718</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:22:18 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-718</guid>
		<description>One more thing, rather than explicitly using memcache, you should be able to call the asynch method directly:

PhotoWorker.asynch_send_hour_warning

That should add the correct message to your queue. The downside, however, of this approach is that you will need to load your rails environment.</description>
		<content:encoded><![CDATA[<p>One more thing, rather than explicitly using memcache, you should be able to call the asynch method directly:</p>
<p>PhotoWorker.asynch_send_hour_warning</p>
<p>That should add the correct message to your queue. The downside, however, of this approach is that you will need to load your rails environment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/comment-page-2/#comment-717</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-717</guid>
		<description>When you fire off the task with cron are you setting RAILS_ENV=production for the script? That&#039;s usually what is missing if it works in development.

I usually add an:

export RAILS=production

for the bash profile of the user I run cron and/or rails processes for. This way I know the environment will be set correctly when I execute cron or rake tasks.</description>
		<content:encoded><![CDATA[<p>When you fire off the task with cron are you setting RAILS_ENV=production for the script? That&#8217;s usually what is missing if it works in development.</p>
<p>I usually add an:</p>
<p>export RAILS=production</p>
<p>for the bash profile of the user I run cron and/or rails processes for. This way I know the environment will be set correctly when I execute cron or rake tasks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
