event_reader.web3worker
Documentation for eth_defi.event_reader.web3worker Python module.
Web3 thread pool worker helpers.
Functions
|
Create a thread pool executor. |
Get the Web3 connection for the worker. |
- get_worker_web3()
Get the Web3 connection for the worker.
The connection was initialized when the worker thread was created.
- Return type
web3.main.Web3
- create_thread_pool_executor(factory, context=None, max_workers=16)
Create a thread pool executor.
All pool members have the thread locals initialized at start, so that there is Web3 connection available.
- Parameters
factory (eth_defi.event_reader.web3factory.Web3Factory) – The factory that provides web3 connection for each threaad after a thread has been launched.
context (Optional[eth_defi.event_reader.logresult.LogContext]) –
Event reader context.
If you want to pass something extra for the event reader.
max_workers – How many threads are allocated for futureproof pool.
- Return type
futureproof.executors.ThreadPoolExecutor