File tree 1 file changed +2
-2
lines changed
examples/tools/async_websocket_rest_handler 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ class ApiCallHandler:
12
12
def __init__ (self ):
13
13
self .api_call_queue = asyncio .Queue ()
14
14
self .executor = ThreadPoolExecutor () # Thread pool for running synchronous code
15
+ self .client = RESTClient () # Assumes POLYGON_API_KEY is set in the environment
15
16
16
17
async def enqueue_api_call (self , options_ticker ):
17
18
await self .api_call_queue .put (options_ticker )
@@ -33,8 +34,7 @@ async def start_processing_api_calls(self):
33
34
self .api_call_queue .task_done ()
34
35
35
36
def get_options_contract (self , options_ticker ):
36
- client = RESTClient () # Assumes POLYGON_API_KEY is set in the environment
37
- return client .get_options_contract (options_ticker )
37
+ return self .client .get_options_contract (options_ticker )
38
38
39
39
40
40
class MessageHandler :
You can’t perform that action at this time.
0 commit comments