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
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