mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 13:41:31 +00:00
Introduce [de]serialize_tfw_msg() methods to abstract away enveloping
This commit is contained in:
parent
18e9ee5f52
commit
67a23166c6
@ -2,6 +2,7 @@
|
||||
# All Rights Reserved. See LICENSE file for details.
|
||||
|
||||
from .serialization import decode_if_needed, encode_if_needed, serialize_all, deserialize_all
|
||||
from .serialization import serialize_tfw_msg, deserialize_tfw_msg
|
||||
from .zmq_connector_base import ZMQConnectorBase
|
||||
from .controller_connector import ControllerConnector
|
||||
from .message_sender import MessageSender
|
||||
|
@ -4,6 +4,14 @@
|
||||
import json
|
||||
|
||||
|
||||
def serialize_tfw_msg(message):
|
||||
return serialize_all(message['key'], message)
|
||||
|
||||
|
||||
def deserialize_tfw_msg(*args):
|
||||
return deserialize_all(*args)[1]
|
||||
|
||||
|
||||
def serialize_all(*args):
|
||||
return tuple(_serialize_single(arg) for arg in args)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user