Skip to content

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

@0rtis

Description

@0rtis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions