mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
- style cleanup
- Add MultiQueue#<< alias to #push
This commit is contained in:
parent
85db3348df
commit
08abcbea9d
1 changed files with 6 additions and 0 deletions
|
@ -1,13 +1,19 @@
|
|||
class MultiQueue
|
||||
public
|
||||
def initialize(*queues)
|
||||
@mutex = Mutex.new
|
||||
@queues = queues
|
||||
end
|
||||
|
||||
# Push an object to all queues.
|
||||
public
|
||||
def push(object)
|
||||
@queues.each { |q| q.push(object) }
|
||||
end
|
||||
|
||||
alias_method :<<, :push
|
||||
|
||||
# Add a new Queue to this queue.
|
||||
public
|
||||
def add_queue(queue)
|
||||
@mutex.synchronize do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue