Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
0rtis opened this issue Jun 2, 2023 · 0 comments

Comments

@0rtis
Copy link

0rtis commented Jun 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant