def add_hook(payload_class, hook_arg = nil, &hook_block)
      hook = block_given? ? hook_block : hook_arg
      if !hook || !hook.is_a?(Proc)
        raise "Must pass a proc either as an argument or a block"
      end
      @message_hooks[payload_class] << hook
    end
def add_hook(payload_class, hook_arg = nil, &hook_block)
      hook = block_given? ? hook_block : hook_arg
      if !hook || !hook.is_a?(Proc)
        raise "Must pass a proc either as an argument or a block"
      end
      @message_hooks[payload_class] << hook
    end
Adds a block to be run when a payload of class `payload_class` is received
 @param payload_class [Class] Payload type to execute block on
 @param &hook [Proc] Hook to run
 @api private
 @return [void]