ezmsg-org / ezmsg

Pure-Python DAG-based high-performance SHM-backed pub-sub and multi-processing pattern
https://ezmsg.readthedocs.io/en/latest/
MIT License
15 stars 6 forks source link

Move timestamp addtion from codec to logger/replay #98

Closed pperanich closed 8 months ago

pperanich commented 9 months ago

Remove timestamp from messagecodec JSON encoder. Instead, wrap top-level objects in dict with ts and obj fields. This solves a few issues:

  1. MessageEncoder assigning different timestamps for a dataclass object and any children dataclass objects
  2. MessageEncoder/Decoder previously failed on messages that were not dataclasses.
cboulay commented 8 months ago

I really only use the logger for temp files, and mostly only in unit tests. I don't have any old logs that I need to re-open. I'm fine with this backward incompatibility.