Move the spawn code out of the poll method.
This commit is contained in:
parent
caca0b1398
commit
d020c0c9bf
@ -84,9 +84,7 @@ module Telepathy
|
||||
end
|
||||
end
|
||||
|
||||
def poll
|
||||
if !@poll_running
|
||||
@poll_running = true
|
||||
private def spawn_workers
|
||||
spawn do
|
||||
loop do
|
||||
action = @poll_channel.receive
|
||||
@ -113,6 +111,12 @@ module Telepathy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def poll
|
||||
if !@poll_running
|
||||
@poll_running = true
|
||||
spawn_workers
|
||||
end
|
||||
@poll_channel.send nil
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user