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 335
335:       def initialize(block)
336:         @thread = Thread.current
337:         @block = block
338:       end

Public Instance methods

[Source]

     # File lib/xmpp4r/stream.rb, line 339
339:       def call(*args)
340:         @block.call(*args)
341:       end

[Source]

     # File lib/xmpp4r/stream.rb, line 346
346:       def raise(exception)
347:         @thread.raise(exception) if @thread.alive?
348:       end

[Source]

     # File lib/xmpp4r/stream.rb, line 342
342:       def wakeup
343:         # TODO: Handle threadblock removal if !alive?
344:         @thread.wakeup if @thread.alive?
345:       end

[Validate]