lilspikey / django-background-task

A database-backed work queue for Django
BSD 3-Clause "New" or "Revised" License
107 stars 200 forks source link

Why not pickle? #5

Closed emacsway closed 12 years ago

emacsway commented 12 years ago

Hi, why JSON serialize, not pickle?

P.S.: Solution is very interesting, it's much simpler than celery.

lilspikey commented 12 years ago

I picked JSON for stability.

I know there are sometimes issues with pickle not working across versions of Python and also I've been burnt by things that can be pickled, but can't be unpickled in the past. If you then think about having to handle upgrades to your code - you change the class of an object that has been pickled - then it avoids a whole bunch of headaches.

Also it does mean that if you (for some reason) needed to switch to a different type of queue or interoperate with other languages it's fairly easy to pull the data out of the database.