61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/qwirk/adapter/in_memory/queue.rb', line 61
def write(obj)
@array_mutex.synchronize do
while !@stopping
if @max_size == 0
Qwirk.logger.warn "No worker for queue #{@name}, dropping message #{obj.inspect}"
return
end
if @max_size < 0 || @array.size < @max_size
@array << obj
@read_condition.signal
return
end
@write_condition.wait(@array_mutex)
end
Qwirk.logger.warn "Queue has been stopped #{@name}, dropping message #{obj.inspect}"
end
end
|