问题
I have a bunch of client processes which make queries to a single worker process (which then processes them in batches) using a shared queue. However the clients need to know when the results are ready, so I tried putting a tuple with a concurrent.futures.Future along with the request in the queue, but Python throws a "cannot pickle" exception (this only happens with the future object).
Is there a picklable version of Future that I can use for this purpose, or a better design altogether?
来源:https://stackoverflow.com/questions/47890254/cant-put-future-in-manager-queue-in-python