procrastinate
procrastinate copied to clipboard
JsonMapper object
trafficstars
We need an abstraction layer over json loading and dumping because:
- It's needed in connectors (and we wish we wouldn't have to set it up in every connector)
- It's needed in the CLI (for procrastinate defer)
What we think about doing:
- Create a class JsonMapper(json_loads: Optional[Callable], json_dumps: Optional[Callable])
- Store a json mapper in the App
- When building the Connector, set its json mapper (not via the constructor)
- The CLI should use app.json_mapper in defer()