Skip to content

Commit db4b9a2

Browse files
author
Matthias Zimmermann
committed
feat: add timeout to provider builder
1 parent a055ecf commit db4b9a2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/arkiv/provider.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ class ProviderBuilder:
4646
Fluent builder for Web3 providers with Arkiv presets.
4747
4848
Examples:
49-
- ProviderBuilder().localhost().build() # http://127.0.0.1:8545 (HTTPProvider)
50-
- ProviderBuilder().localhost(9000).ws().build() # ws://127.0.0.1:9000 (WebSocketProvider, async)
51-
- ProviderBuilder().localhost().async_mode().build() # http://127.0.0.1:8545 (AsyncHTTPProvider)
52-
- ProviderBuilder().kaolin().build() # https://kaolin.hoodi.arkiv.network/rpc
53-
- ProviderBuilder().custom("https://my-rpc.io").build() # https://my-rpc.io
54-
- ProviderBuilder().node().build() # Auto-creates and starts ArkivNode
55-
- ProviderBuilder().node(my_node).ws().build() # Use existing node with WebSocket (async)
49+
- ProviderBuilder().localhost().build() # http://127.0.0.1:8545 (HTTPProvider)
50+
- ProviderBuilder().localhost(9000).ws().build() # ws://127.0.0.1:9000 (WebSocketProvider, async)
51+
- ProviderBuilder().localhost().async_mode().build() # http://127.0.0.1:8545 (AsyncHTTPProvider)
52+
- ProviderBuilder().kaolin().build() # https://kaolin.hoodi.arkiv.network/rpc
53+
- ProviderBuilder().kaolin().timeout(5).async_mode().build() # as above, but AsyncHTTPProvider with 5 second timeout
54+
- ProviderBuilder().custom("https://my-rpc.io").build() # https://my-rpc.io
55+
- ProviderBuilder().node().build() # Auto-creates and starts ArkivNode
56+
- ProviderBuilder().node(my_node).ws().build() # Use existing node with WebSocket (async)
5657
5758
Note:
5859
For best practice, call async_mode() at the end of your builder chain, just before build():

0 commit comments

Comments
 (0)