def dumps(self, msg): ''' Run the correct dumps serialization format ''' if self.serial == 'pickle': return pickle.dumps(msg) else: return msgpack.dumps(msg)
def package(payload): ''' This method for now just wraps msgpack.dumps, but it is here so that we can make the serialization a custom option in the future with ease. ''' return msgpack.dumps(payload)