<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -45,3 +45,7 @@ v0.7 - 2008/04/24
 v0.8 - 2008/05/02
 * call exit! within the ensure block so that at_exit handlers aren't called on exceptions
 * set logger from RAILS_DEFAULT_LOGGER if available, else STDERR
+
+--------------------------------------------------
+v0.9 - 2008/05/11
+* added ability to set nice level for child process</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,13 @@ spawn to Spawn::wait(), like this:
   # wait for all N blocks of code to finish running
   wait(spawn_ids)
 
+If you want your forked child to run at a lower priority than the parent process, pass in
+the :nice option like this:
+
+  spawn(:nice =&gt; 7) do
+    do_something_nicely
+  end
+
 By default, spawn will use the fork to spawn child processes.  You can configure it to
 do threading either by telling the spawn method when you call it or by configuring your
 environment.
@@ -104,7 +111,7 @@ blog post on threading in rails.
     http://bibwild.wordpress.com/2007/08/28/threading-in-rails/
     
 Also thanks to all who have helped debug problems and suggest improvements including:
-  Ahmed Adam, Tristan Schneiter, Scott Haug, Andrew Garfield, Eugene Otto, &lt;your name here&gt;
-
+  Ahmed Adam, Tristan Schneiter, Scott Haug, Andrew Garfield, Eugene Otto, Dan Sharp,
+  &lt;your name here&gt;
 
 Copyright (c) 2007-08 Tom Anderson (tom@squeat.com), see LICENSE</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -87,12 +87,18 @@ module Spawn
       begin
         start = Time.now
         @@logger.debug &quot;spawn&gt; child PID = #{Process.pid}&quot;
+
+        # set the nice priority if needed
+        Process.setpriority(Process::PRIO_PROCESS, 0, options[:nice]) if options[:nice]
+
         # disconnect from the listening socket, et al
         Spawn.close_resources
         # get a new connection so the parent can keep the original one
         ActiveRecord::Base.spawn_reconnect
+
         # run the block of code that takes so long
         yield
+
       rescue =&gt; ex
         @@logger.error &quot;spawn&gt; Exception in child[#{Process.pid}] - #{ex.class}: #{ex.message}&quot;
       ensure</diff>
      <filename>lib/spawn.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a3aa889cdc28ab31b38b61df93801edfe2a66551</id>
    </parent>
  </parents>
  <author>
    <name>tra</name>
    <email>tra@2aabfe31-cc40-457c-aec7-21ad9ce7fb7d</email>
  </author>
  <url>http://github.com/tra/spawn/commit/c525078436ae427e3615092952cc811f75206759</url>
  <id>c525078436ae427e3615092952cc811f75206759</id>
  <committed-date>2008-05-11T12:38:13-07:00</committed-date>
  <authored-date>2008-05-11T12:38:13-07:00</authored-date>
  <message>added :nice option


git-svn-id: svn+ssh://rubyforge.org/var/svn/spawn/spawn@19 2aabfe31-cc40-457c-aec7-21ad9ce7fb7d</message>
  <tree>ce35599123093902438fda45314d6c58a9a2b0b7</tree>
  <committer>
    <name>tra</name>
    <email>tra@2aabfe31-cc40-457c-aec7-21ad9ce7fb7d</email>
  </committer>
</commit>
