Ejemplo n.º 1
0
 def dumps(self, msg):
     '''
     Run the correct dumps serialization format
     '''
     if self.serial == 'pickle':
         return pickle.dumps(msg)
     else:
         return msgpack.dumps(msg)
Ejemplo n.º 2
0
 def dumps(self, msg):
     '''
     Run the correct dumps serialization format
     '''
     if self.serial == 'pickle':
         return pickle.dumps(msg)
     else:
         return msgpack.dumps(msg)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)