Skip to content
  • Oto Šťáva's avatar
    c375cf2c
    manager: use proper JSON values for socket communication · c375cf2c
    Oto Šťáva authored and Aleš Mrázek's avatar Aleš Mrázek committed
    This commit adds a special JSON mode for control sockets.
    
    The mode is activated by issuing a special `__json` command to the
    socket, resulting in all Lua objects returned by all subsequent commands
    to be serialized into JSONs, prepended by a 32-bit unsigned integer
    byte-length value.
    
    This JSON mode is now exclusively utilized by Manager, removing the need
    to hackily strip single-quotes from the output and to read the output by
    lines. Instead, it can always just read the 32-bit length value and
    subsequently the whole JSON-formatted message, which is now
    automatically deserialized into a Python object.
    c375cf2c
    manager: use proper JSON values for socket communication
    Oto Šťáva authored and Aleš Mrázek's avatar Aleš Mrázek committed
    This commit adds a special JSON mode for control sockets.
    
    The mode is activated by issuing a special `__json` command to the
    socket, resulting in all Lua objects returned by all subsequent commands
    to be serialized into JSONs, prepended by a 32-bit unsigned integer
    byte-length value.
    
    This JSON mode is now exclusively utilized by Manager, removing the need
    to hackily strip single-quotes from the output and to read the output by
    lines. Instead, it can always just read the 32-bit length value and
    subsequently the whole JSON-formatted message, which is now
    automatically deserialized into a Python object.
Loading