peter-wangxu / persist-queue

A thread-safe disk based persistent queue in Python
BSD 3-Clause "New" or "Revised" License
335 stars 50 forks source link

CBOR serializer (using cbor2 package) #191

Closed brendan-simon-indt closed 1 year ago

brendan-simon-indt commented 1 year ago

Add CBOR serializer support, using the cbor2 package. CBOR protocol is similar to msgpack, however CBOR has a cleaner design, is standardized and preferred over msgpack by some.

I modelled the implementation based on the msgpack implementation.

I arbitrarily chose cbor2 5.2.0 has the minimum version requirement, as this was the first release to make it into a Debian distribution as a pre-built package (Debian 11 Bullseye). It is likely that earlier cbor2 versions would also work.

peter-wangxu commented 1 year ago

@brendan-simon-indt looks fine, please address the comment in code and pep8 issue in CI

./persistqueue\serializers\cbor2.py:29:1: E302 expected 2 blank lines, found 1