procrastinate icon indicating copy to clipboard operation
procrastinate copied to clipboard

JsonMapper object

Open ewjoachim opened this issue 5 years ago • 0 comments
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()

ewjoachim avatar Jun 12 '20 09:06 ewjoachim