Skip to content

Commit

Permalink
added ready? flag for external threads
Browse files Browse the repository at this point in the history
  • Loading branch information
mojodna committed Dec 2, 2008
1 parent e30c1e8 commit e0b2877
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/switchboard/core.rb
Expand Up @@ -75,6 +75,8 @@ def initialize(settings = Switchboard::Settings.new, spin = true, &block)
def run!
startup

@ready = true

if @main
instance_eval(&@main)
elsif loop?
Expand Down Expand Up @@ -132,6 +134,10 @@ def plug!(*jacks)
end
end

def ready?
@ready
end

hook(:exception, :iq, :message, :presence, :startup, :stream_connected, :shutdown)

protected
Expand Down

0 comments on commit e0b2877

Please sign in to comment.