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   wakeup  

Public Class methods

[Source]

     # File lib/xmpp4r/stream.rb, line 343
343:       def initialize(block)
344:         @thread = Thread.current
345:         @block = block
346:       end

Public Instance methods

[Source]

     # File lib/xmpp4r/stream.rb, line 347
347:       def call(*args)
348:         @block.call(*args)
349:       end

[Source]

     # File lib/xmpp4r/stream.rb, line 354
354:       def raise(exception)
355:         @thread.raise(exception) if @thread.alive?
356:       end

[Source]

     # File lib/xmpp4r/stream.rb, line 350
350:       def wakeup
351:         # TODO: Handle threadblock removal if !alive?
352:         @thread.wakeup if @thread.alive?
353:       end

[Validate]