Here's my issue with this kind of "magic" API design: It's not clear when or how serialization happens. Supposedly at some point the message I am sending to the worker is serialized, but this is not made clear to the user and it's not made clear when this happens. A well-designed library would synchronously serialize the given object the moment it is passed in or let the user explicitly handle serialization. But I do…
I definitely ran into some serialization issues when trying Piscina a while ago. Returning generated images from the workers would keep getting slower and slower until the overhead of data exchange was 20x the time it took to generate it.
I discovered through trial and error that returning image bytes directly would incur this ever increasing overhead, btu creating a binary buffer and returning that would not. It was just a pet weekend project, so I never did discover what was causing the issue.