Skip to content

Commit

Permalink
have zmq workers die or kill them after 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
abrandoned committed Mar 11, 2013
1 parent 4af256a commit 9da0c3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/protobuf/rpc/servers/zmq/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def self.stop
@running = false

@threads.each do |t|
t.join
t.join(5) || t.kill
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

it 'lets all threads stop' do
thread_mock = double(Thread)
thread_mock.should_receive(:join)
thread_mock.should_receive(:join).and_return(thread_mock)
described_class.instance_variable_set(:@threads, [thread_mock])
described_class.stop
end
Expand Down

0 comments on commit 9da0c3c

Please sign in to comment.