Sha256: 2903b6897c5df1bd6d8fe73585eeb1c69d4210f456245c74ffcf8360caa86f0c
Contents?: true
Size: 640 Bytes
Versions: 32
Compression:
Stored size: 640 Bytes
Contents
module Msgr class Consumer include Logging attr_reader :message delegate :payload, to: :@message delegate :action, to: :'@message.route' delegate :consumer, to: :'@message.consumer' def dispatch(message) @message = message action = message.route.action.to_sym raise Msgr::NoAction.new "No action `#{action}` for `#{self.class.name}`." unless respond_to? action log(:debug) { "Invoke action #{action.inspect}." } send action log(:debug) { "Action #{action.inspect} done." } end def publish(data, opts = {}) Msgr.client.publish(data, opts) end end end
Version data entries
32 entries across 32 versions & 1 rubygems