File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
examples/tools/async_websocket_rest_handler Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ class ApiCallHandler:
1212 def __init__ (self ):
1313 self .api_call_queue = asyncio .Queue ()
1414 self .executor = ThreadPoolExecutor () # Thread pool for running synchronous code
15+ self .client = RESTClient () # Assumes POLYGON_API_KEY is set in the environment
1516
1617 async def enqueue_api_call (self , options_ticker ):
1718 await self .api_call_queue .put (options_ticker )
@@ -33,8 +34,7 @@ async def start_processing_api_calls(self):
3334 self .api_call_queue .task_done ()
3435
3536 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 )
3838
3939
4040class MessageHandler :
You can’t perform that action at this time.
0 commit comments