Method: Bluth.onconnect

Defined in:
lib/bluth.rb

.onconnect(&blk) ⇒ Object

A block to be called before a worker starts.

e.g.

Bluth.onconnect do
  config = YourProject.load_config
  Familia.uri = config[:redis_uri]
end

Note: this block can be called multiple times so do not put anything with side effects in here.



62
63
64
65
# File 'lib/bluth.rb', line 62

def onconnect &blk
  @onconnect = blk unless blk.nil?
  @onconnect
end