Add speedyf/process.py

This commit is contained in:
Fred Boniface 2024-04-30 21:16:03 +01:00
parent 8804dcb9ad
commit 42caef4beb
1 changed files with 13 additions and 0 deletions

13
speedyf/process.py Normal file
View File

@ -0,0 +1,13 @@
import asyncio
from functools import partial
from subprocess import run
semaphore = asyncio.Semaphore(2)
async def process_pdf(file_path, ctx):
async with semaphore:
# Set status to runnin
cmd = "cmd"
process = await asyncio.create_subprocess_exec(cmd)
await process.await()
# Set status to done.