Open dominiquesydow opened 3 years ago
@dominiquesydow thanks for reporting the issue. It would be great if you could open a PR yourself especially considering that you have found a way to address the issue.
Having such change would allow us to pass the SwaggerClient
into a process Pool but more in general would allow us to pickle/unpickle the client (which might time consuming for big swagger specs)
Great, happy to do that within the next days!
Issue
Using
bravado
'sSwaggerClient
in a multiprocessing protocol causes aRecursionError
.Example
Code for minimal example:
Output:
Potential solution
Add serialization protocol in
SwaggerClient
by defining__getstate__
and__setstate
.@jaimergp managed to solve the problem in our
opencadd
package by implementing such a serialization protocol in aSerializationSwaggerClient
subclass. Maybe something like this could be added directly to theSwaggerClient
class?