Skip to content

Instantly share code, notes, and snippets.

View Sadbot's full-sized avatar
🐍
python

Sem Sadbot

🐍
python
View GitHub Profile
@Sadbot
Sadbot / async.py
Created August 2, 2021 10:01 — forked from konpatp/async.py
Python turn sync functions to async (and async to sync)
import functools
def force_async(fn):
'''
turns a sync function to async function using threads
'''
from concurrent.futures import ThreadPoolExecutor
import asyncio
pool = ThreadPoolExecutor()
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶