Method: Beetle::Message#aquire_mutex!

Defined in:
lib/beetle/message.rb

#aquire_mutex!Object

aquire execution mutex before we run the handler (and delete it if we can’t aquire it).



241
242
243
244
245
246
247
248
# File 'lib/beetle/message.rb', line 241

def aquire_mutex!
  if mutex = @store.setnx(msg_id, :mutex, now)
    logger.debug "Beetle: aquired mutex: #{msg_id}"
  else
    delete_mutex!
  end
  mutex
end