This merge request includes the following changes:
Serialization
Add the possibility to pass a "deserialization" function to the listener. The default behavior has not been altered. By default json.loads is used. This would allow a client to use formats other than json, but if they choose to do so, they have to provide their own handling function. (This is the change that pushed me to make these changes, since I needed to handle other formats than json)
Log the stacktrace of the error in case something happens during deserialization. I thought this might be more useful during debugging than the previous message, since the error could now be anything.
Add the possibility to pass a "serialization" function to the "launcher". This allows the client for example to use custom types in their dictionary, and then provide the proper serialization function that knows how to handle those types where a json.dumps would fail.
Update README to reflect these changes.
Python 2.7 compatibility
wrap queue and queue_url in a list before passing it to the any function in the launcher constructor.
Remove trailing comma at line 87 (old) / 89 (new) of the launcher (the trailing comma causes an error at runtime on python 2.7).
Initialize the boto3_session variable in the constructor before the blocks that can set / inspect its value. "Variable used before being declared" errors would pop up otherwise.
These "compatibility" changes are pretty minor, and allow for the library to still be used by python 2.7.
Please feel free to tell me if anything is unclear or you wish to discuss or change something in the proposed merge request.
Hello,
This merge request includes the following changes:
Serialization
Add the possibility to pass a "deserialization" function to the listener. The default behavior has not been altered. By default json.loads is used. This would allow a client to use formats other than json, but if they choose to do so, they have to provide their own handling function. (This is the change that pushed me to make these changes, since I needed to handle other formats than json)
Log the stacktrace of the error in case something happens during deserialization. I thought this might be more useful during debugging than the previous message, since the error could now be anything.
Add the possibility to pass a "serialization" function to the "launcher". This allows the client for example to use custom types in their dictionary, and then provide the proper serialization function that knows how to handle those types where a
json.dumps
would fail.Update README to reflect these changes.
Python 2.7 compatibility
any
function in the launcher constructor.boto3_session
variable in the constructor before the blocks that can set / inspect its value. "Variable used before being declared" errors would pop up otherwise.These "compatibility" changes are pretty minor, and allow for the library to still be used by python 2.7.
Please feel free to tell me if anything is unclear or you wish to discuss or change something in the proposed merge request.
Regards,