Class Jabber::Stream::ThreadBlock
In: lib/xmpp4r/stream.rb
Parent: Object

This is used by Jabber::Stream internally to keep track of any blocks which were passed to Stream#send.

Methods

call   new   raise   wait   wakeup  

Public Class methods

[Source]

     # File lib/xmpp4r/stream.rb, line 322
322:       def initialize(block)
323:         @block = block
324:         @waiter = Semaphore.new
325:         @exception = nil
326:       end

Public Instance methods

[Source]

     # File lib/xmpp4r/stream.rb, line 327
327:       def call(*args)
328:         @block.call(*args)
329:       end

[Source]

     # File lib/xmpp4r/stream.rb, line 337
337:       def raise(exception)
338:         @exception = exception
339:         @waiter.run
340:       end

[Source]

     # File lib/xmpp4r/stream.rb, line 330
330:       def wait
331:         @waiter.wait
332:         raise @exception if @exception
333:       end

[Source]

     # File lib/xmpp4r/stream.rb, line 334
334:       def wakeup
335:         @waiter.run
336:       end

[Validate]