<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
+examples/queue_worker_example.rb
 examples/token_worker_example.rb
 History.rdoc
 lib/init.rb
@@ -11,7 +12,6 @@ Manifest
 politics.gemspec
 Rakefile
 README.rdoc
-test/bucket_worker_test.rb
 test/static_queue_worker_test.rb
 test/test_helper.rb
 test/token_worker_test.rb</diff>
      <filename>Manifest</filename>
    </modified>
    <modified>
      <diff>@@ -4,12 +4,15 @@ require 'politics/token_worker'
 
 # Test this example by starting memcached locally and then in two irb sessions, run this:
 #
-# require 'token_worker_example'
-# p = Politics::TokenWorkerExample.new
-# p.start
 #
 # You can then watch as one of them is elected leader.  You can kill the leader and verify
 # the backup process is elected after approximately iteration_length seconds.
+#
+=begin
+ require 'token_worker_example'
+ p = Politics::TokenWorkerExample.new
+ p.start
+=end
 module Politics
   class TokenWorkerExample
     include Politics::TokenWorker
@@ -20,12 +23,12 @@ module Politics
     
     def start
       process do
-				puts &quot;PID #{$$} processing at #{Time.now}...&quot;
+        puts &quot;PID #{$$} processing at #{Time.now}...&quot;
       end
     end
     
     def memcached_servers
-			['localhost:11211']
+      ['localhost:11211']
     end
 
   end</diff>
      <filename>examples/token_worker_example.rb</filename>
    </modified>
    <modified>
      <diff>@@ -78,7 +78,6 @@ module Politics
       @bucket_count = bucket_count
       initialize_buckets
 
-		  start_drb
 		  register_with_bonjour
 		  
 		  log.info { &quot;Registered #{self} in group #{group_name} at port #{@port}&quot; }
@@ -228,21 +227,19 @@ module Politics
     
     
 		def register_with_bonjour
+		  server = DRb.start_service(nil, self)
+		  @uri = DRb.uri
+		  @port = URI.parse(DRb.uri).port
+
 		  # Register our DRb server with Bonjour.
       handle = Net::DNS::MDNSSD.register(&quot;#{self.group_name}-#{local_ip}-#{$$}&quot;, 
           &quot;_#{group_name}._tcp&quot;, 'local', @port)
           
       ['INT', 'TERM'].each { |signal| 
-        trap(signal) { handle.stop }
-      }
-	  end
-		
-		def start_drb
-		  server = DRb.start_service(nil, self)
-		  @uri = DRb.uri
-		  @port = URI.parse(DRb.uri).port
-      ['INT', 'TERM'].each { |signal| 
-        trap(signal) { server.stop_service }
+        trap(signal) do
+          handle.stop
+          server.stop_service
+        end
       }
 	  end
 		</diff>
      <filename>lib/politics/static_queue_worker.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,11 +9,11 @@ Gem::Specification.new do |s|
 
 	s.require_path = 'lib'
 
-	# get this easily and accurately by running 'Dir.glob(&quot;{lib,test}/**/*&quot;)'
+	# get this easily and accurately by running 'Dir.glob(&quot;{lib,examples}/**/*&quot;)'
 	# in an IRB session.  However, GitHub won't allow that command hence
 	# we spell it out.
-	s.files = [&quot;README.rdoc&quot;, &quot;LICENSE&quot;, &quot;History.rdoc&quot;, &quot;Rakefile&quot;, &quot;lib/init.rb&quot;, &quot;lib/politics&quot;, &quot;lib/politics/bucket_worker.rb&quot;, &quot;lib/politics/discoverable_node.rb&quot;, &quot;lib/politics/token_worker.rb&quot;, &quot;lib/politics/version.rb&quot;, &quot;lib/politics.rb&quot;]
-	s.test_files = [&quot;test/bucket_worker_test.rb&quot;, &quot;test/political_test.rb&quot;, &quot;test/test_helper.rb&quot;, &quot;test/token_worker_test.rb&quot;]
+	s.files = [&quot;lib/init.rb&quot;, &quot;lib/politics&quot;, &quot;lib/politics/discoverable_node.rb&quot;, &quot;lib/politics/static_queue_worker.rb&quot;, &quot;lib/politics/token_worker.rb&quot;, &quot;lib/politics/version.rb&quot;, &quot;lib/politics.rb&quot;, &quot;examples/queue_worker_example.rb&quot;, &quot;examples/token_worker_example.rb&quot;]
+	s.test_files = [&quot;test/static_queue_worker_test.rb&quot;, &quot;test/test_helper.rb&quot;, &quot;test/token_worker_test.rb&quot;]
 	s.has_rdoc = true
 	s.rdoc_options = [&quot;--quiet&quot;, &quot;--title&quot;, &quot;Politics documentation&quot;, &quot;--opname&quot;, &quot;index.html&quot;, &quot;--line-numbers&quot;, &quot;--main&quot;, &quot;README.rdoc&quot;, &quot;--inline-source&quot;]
 	s.extra_rdoc_files = [&quot;README.rdoc&quot;, &quot;History.rdoc&quot;, &quot;LICENSE&quot;]</diff>
      <filename>politics.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3122d61670777c1210815c0b4479cd6c220eb140</id>
    </parent>
  </parents>
  <author>
    <name>Mike Perham</name>
    <email>mperham@gmail.com</email>
  </author>
  <url>http://github.com/mperham/politics/commit/8b7b8fcfd36811e53b6e8a7ac51d318a6268e174</url>
  <id>8b7b8fcfd36811e53b6e8a7ac51d318a6268e174</id>
  <committed-date>2008-10-28T14:55:53-07:00</committed-date>
  <authored-date>2008-10-28T14:55:53-07:00</authored-date>
  <message>Add static queue worker example
Update gemspec with latest files.
TODO Something is still very wrong with signal handling with SQW.</message>
  <tree>3fa5a49c2cd0b197f9aa79556b2e8837bf757109</tree>
  <committer>
    <name>Mike Perham</name>
    <email>mperham@gmail.com</email>
  </committer>
</commit>
