multicall.py icon indicating copy to clipboard operation
multicall.py copied to clipboard

Error with ThreadPool 'Timeout context manager should be used inside a task'

Open 0rtis opened this issue 2 years ago • 0 comments

Using Multicall more than once in a thread throw an error Timeout context manager should be used inside a task. This error was previously reported here #41 and was fixed there #51 However, I am facing this error while using Multicall in a ThreadPool:

tp = ThreadPool(processes=1)
tp.apply_async(func=execute, args=(task, ))

def execute(task):
    w3 = Web3(Web3.HTTPProvider('http://rpc.url'))
    for v in Multicall(self.calls, _w3=w3)().values():
        print(v)

I am using multicall 0.7.2 and web3 6.4.0 Same results using web3 5.31.3 as recommend in issue #41

0rtis avatar Jun 02 '23 13:06 0rtis