jobby 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +8 -0
  2. data/bin/jobby +1 -1
  3. data/lib/server.rb +7 -1
  4. metadata +2 -2
data/README CHANGED
@@ -93,3 +93,11 @@ of jobs to be run. The most straightforward way to do this is to specify a
93
93
  different socket for the Jobby daemon, using the --socket option. Then, the
94
94
  'jobby' command will run whatever --ruby or --command is specified for the
95
95
  daemon running on that socket.
96
+
97
+
98
+ == Copy-on-write ==
99
+
100
+ The Jobby::Server will enable the copy-on-write-friendly code when the
101
+ interpretter supports it. You might not want this, but can disable it by
102
+ passing calling GC.copy_on_write_friendly = true within a file that is
103
+ --prerun.
data/bin/jobby CHANGED
@@ -38,7 +38,7 @@ OptionParser.new do |opts|
38
38
  end
39
39
 
40
40
  opts.on("--version", "Show version") do
41
- puts "0.3.3"
41
+ puts "0.3.4"
42
42
  exit
43
43
  end
44
44
 
@@ -23,6 +23,9 @@ module Jobby
23
23
  # This is a generic server class which accepts connections on a UNIX socket. On
24
24
  # receiving a connection, the server process forks and runs the specified block.
25
25
  #
26
+ # By default, this class will enable the copy-on-write code if the interpretter
27
+ # supports it.
28
+ #
26
29
  # ==Example
27
30
  #
28
31
  # Jobby::Server.new("/tmp/jobby.socket", 3, "/var/log/jobby.log").run do
@@ -61,6 +64,9 @@ module Jobby
61
64
  reopen_standard_streams
62
65
  close_fds
63
66
  start_logging
67
+ if GC.respond_to?(:copy_on_write_friendly=)
68
+ GC.copy_on_write_friendly = true
69
+ end
64
70
  @socket_path = socket_path
65
71
  @max_forked_processes = max_forked_processes.to_i
66
72
  @queue = Queue.new
@@ -108,7 +114,7 @@ module Jobby
108
114
  # and STDERR. This is because we might have inherited some FDs from the
109
115
  # calling process, which we don't want.
110
116
  def close_fds
111
- Dir.entries("/proc/#{Process.pid}/fd/").each do |file|
117
+ Dir.entries("/dev/fd/").each do |file|
112
118
  unless file == '.' or file == '..' or file.to_i < 3
113
119
  IO.new(file.to_i).close rescue nil
114
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Somerville
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-21 00:00:00 +00:00
12
+ date: 2008-12-15 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15