TypeError: Could not serialize the function

I trying to use ray for multiprocessing on my device.My code stores details of blocks present in ethereum block chain. I basically need it to work more fast as its taking much time.

While adding ray functionality to code I had this error.How could I resolve this?