Module: Broker::Utility

Included in:
Poller, Queue
Defined in:
lib/broker/utility.rb

Instance Method Summary collapse

Instance Method Details

#safe_thread(name, &block) ⇒ Object



10
11
12
13
14
# File 'lib/broker/utility.rb', line 10

def safe_thread(name, &block)
  Thread.new do
    watcher(name, &block)
  end
end

#timestampObject



16
17
18
# File 'lib/broker/utility.rb', line 16

def timestamp
  Time.now.strftime("%Y-%m-%dT%H.%M.%S")
end

#watcher(last_words) ⇒ Object



4
5
6
7
8
# File 'lib/broker/utility.rb', line 4

def watcher(last_words)
  yield
rescue Exception => ex
  raise ex
end