Class: Serf::Messages::MessageAcceptedEvent

Inherits:
Object
  • Object
show all
Includes:
Serf::Message, Util::Uuidable
Defined in:
lib/serf/messages/message_accepted_event.rb

Overview

This event signals that the serf process has accepted a message for processing at a later time. These events are normally sent in response to calling clients, which is a separate signal than any errors given.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::Uuidable

#uuid

Methods included from Serf::Message

#kind, #to_hash, #to_json, #to_msgpack

Constructor Details

#initialize(options = {}) ⇒ MessageAcceptedEvent

Returns a new instance of MessageAcceptedEvent.



19
20
21
22
# File 'lib/serf/messages/message_accepted_event.rb', line 19

def initialize(options={})
  @message = options[:message]
  @uuid = options[:uuid]
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



17
18
19
# File 'lib/serf/messages/message_accepted_event.rb', line 17

def message
  @message
end

Instance Method Details

#attributesObject



24
25
26
27
28
29
# File 'lib/serf/messages/message_accepted_event.rb', line 24

def attributes
  {
    'message' => @message,
    'uuid' => uuid
  }
end

#to_sObject



31
32
33
# File 'lib/serf/messages/message_accepted_event.rb', line 31

def to_s
  to_hash.to_s
end