|
# File jabber4r/protocol.rb, line 120
def receive(element)
Jabber::DEBUG && puts("RECEIVED:\n#{element.to_s}")
@threadBlocks.each do |thread, proc|
begin
proc.call(element)
if element.element_consumed?
@threadBlocks.delete(thread)
thread.wakeup if thread.alive?
return
end
rescue Exception => error
puts error.to_s
puts error.backtrace.join("\n")
end
end
@filters.each_value do |proc|
begin
proc.call(element)
return if element.element_consumed?
rescue Exception => error
puts error.to_s
puts error.backtrace.join("\n")
end
end
end
|