ethereum / lahja

Lahja is a generic multi process event bus implementation written in Python 3.6+ to enable lightweight inter-process communication, based on non-blocking asyncio
MIT License
394 stars 19 forks source link

Use cloudpickle #172

Closed pipermerriam closed 4 years ago

pipermerriam commented 4 years ago

I'm thinking we should use cloudpickle over stdlib pickle as it is able to pickle more things than the stdlib pickle can...

cburgdorf commented 4 years ago

That sounds interesting indeed! But we should absolutely look into the performance impact for such a change.

pipermerriam commented 4 years ago

The other alternative is to go ahead and drop pickle and have event classes be in charge of their own serialization. Very likely that path also gains us some additional performance.

cburgdorf commented 4 years ago

The other alternative is to go ahead and drop pickle and have event classes be in charge of their own serialization

Yeah probably the better direction. Event classes can have a serializer injected and we might ship with default serializers based on pickle and maybe cloudpickle but one can always go down to the metal and serialize in a custom way. This would allow full flexibility without giving up convenience.

pipermerriam commented 4 years ago

I'm replacing this with https://github.com/ethereum/lahja/issues/173