Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make apitools-generated classes pickleable #102

Open
thobrla opened this issue Apr 28, 2016 · 0 comments
Open

Make apitools-generated classes pickleable #102

thobrla opened this issue Apr 28, 2016 · 0 comments

Comments

@thobrla
Copy link
Contributor

thobrla commented Apr 28, 2016

Presently, apitools can generate nested classes, which, because they aren't defined at the top-level of the module, are un-pickleable. Pickling is necessary for passing apitools objects to other processes, which in turn is useful when optimizing performance by spreading work out over multiple processes and threads.

This is a feature request to add __reduce__ and other appropriate logic so that apitools-generated objects can be pickled without any intervention by library consumers. This could be added either to generated classes or the base message classes in protorpclite

As a workaround, the consumers of a generated library can manual using encoding.MessageToJson prior to pickling and JsonToMessage after pickling, but it's extra work for each consumer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant