Lymph uses msgpack to serialize events and rpc arguments. In addition to the types supported directly by msgpack, the lymph serializer also handles the following basic Python types: set, datetime.datetime,, datetime.time, uuid.UUID, and decimal.Decimal.

Object level serialization

Object level serialization can be defined by implementing _lymph_dump_ method in classes subject to serialization.

Object-level serialization can help to produce more concise code in certain situations, e.g.:

class Process(object):

    def _lymph_dump_(self):
        return {

class Node(lymph.Interface):

    def get_processes(self, service_type=None):
        procs = []
        for proc in self._processes:
            if not service_type or proc.service_type == service_type:
        return procs

    def stop(self, service_type=None):
        for proc in self.get_processes(service_type):

In the example above by defining the _lymph_dump_ in our Process class, we were able to reuse the rpc function get_processes.