Skip to content

Commit

Permalink
Fix async call example
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim S <[email protected]>
  • Loading branch information
poplers24 committed Jun 5, 2024
1 parent aaa3e6a commit 10252e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,13 @@ import asyncio
import concurrent.futures
from twocaptcha import TwoCaptcha

captcha_result = await captchaSolver(image)

async def captchaSolver(image):
loop = asyncio.get_running_loop()
with concurrent.future.ThreadPoolExecutor() as pool:
with concurrent.futures.ThreadPoolExecutor() as pool:
result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))
return result

captcha_result = asyncio.run(captchaSolver(image))
```


Expand Down

0 comments on commit 10252e8

Please sign in to comment.