Closed komuw closed 5 years ago
use, sys.getsizeof
;
import json, sys
du =json.dumps(x)
len(du) #653
sys.getsizeof(du) #702 (bytes) <- this is actual size
import zlib
ccc=zlib.compress(du.encode())
len(ccc) #141
sys.getsizeof(ccc) #174B
json.loads(zlib.decompress(ccc)) # returns dict
wiji
itself should not depend on any third-party libraries. Since the sqs broker will have to probably depend on some third party libs, egboto3
, then the sqs broker should not be part of thewiji
python lib.The
sqs
broker however can share the same repo aswiji
: they just have to be two independent python libs with their ownsetup.py
files.The sqs broker should ideally, use an asyncio AWS library.
I do not think
boto3
is asyncio as yet. As such;concurrent.futures.ThreadPoolExecutor