Arborist::

EventAPI

module
Extended With
Loggability

Public Class Methods

anchor
decode( msg )

Decode and return the identifier and payload from the specified msg (a CZTop::Message).

# File lib/arborist/event_api.rb, line 26
def self::decode( msg )
        identifier, encoded_payload = msg.to_a
        payload = MessagePack.unpack( encoded_payload )
        return identifier, payload
end
anchor
encode( identifier, payload )

Encode an event with the specified identifier and payload as a CZTop::Message and return it.

# File lib/arborist/event_api.rb, line 19
def self::encode( identifier, payload )
        encoded_payload = MessagePack.pack( payload )
        return CZTop::Message.new([ identifier, encoded_payload ])
end