import distributed
import logging
def log(msg):
with open('poc.log', 'a') as fh:
fh.write(msg + '\n')
class Dummy:
def __getstate__(self):
log('pickle')
return self.__dict__
def __setstate__(self, state):
self.__dict__ = state
log('unpickle')
cluster = distributed.LocalCluster(n_workers=1, threads_per_worker=1, processes=True)
client = distributed.Client(cluster)
client.submit(lambda x: x, Dummy()).result()
pickle
pickle
unpickle
pickle
pickle
unpickle
In poc.log:
Am I missing something obvious?