Skip to content

Commit

Permalink
Mongrel interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Arcieri committed Feb 8, 2008
1 parent 54a7a30 commit dd3bb3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/mongrel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
server.register '/', Mongrel::DirHandler.new(".")

puts "Running on #{ADDR}:#{PORT}"
server.run
server.start
12 changes: 9 additions & 3 deletions lib/revactor/mongrel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def initialize(host, port, num_processors=950, throttle=0, timeout=60)
@timeout = timeout
end

# Runs the thing. It returns the Actor the listener is running in.
def run
# Start Mongrel. This method executes the Mongrel event loop, and will
# not return until interrupted or explicitly stopped.
def start
begin
while true
begin
Expand All @@ -53,11 +54,16 @@ def run
# STDERR.puts "#{Time.now}: Closed socket."
end
end

# Runs the thing. Returns the Thread the server is running in.
def run
@acceptor = Thread.new { start }
end

# Clean up after any dead workers
def reap_dead_workers(reason = 'unknown')
# FIXME This should signal all workers to die
0
end
end
end
end

0 comments on commit dd3bb3f

Please sign in to comment.