{"id":16653460,"url":"https://github.com/pogodigitalism/syncinasync","last_synced_at":"2025-12-27T10:07:39.736Z","repository":{"id":209033109,"uuid":"723071081","full_name":"PogoDigitalism/SyncInAsync","owner":"PogoDigitalism","description":"A Python class for running non-blocking synchronous code in async","archived":false,"fork":false,"pushed_at":"2024-02-26T15:55:11.000Z","size":34,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T17:36:36.380Z","etag":null,"topics":["async","concurrency","discord-py","sync","threadpool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PogoDigitalism.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-24T15:58:59.000Z","updated_at":"2024-10-29T10:57:18.000Z","dependencies_parsed_at":"2023-12-29T22:59:14.783Z","dependency_job_id":"4b110860-26ee-4e72-a0de-c3e1aa67e930","html_url":"https://github.com/PogoDigitalism/SyncInAsync","commit_stats":null,"previous_names":["pogodigitalism/syncinasync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PogoDigitalism/SyncInAsync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PogoDigitalism%2FSyncInAsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PogoDigitalism%2FSyncInAsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PogoDigitalism%2FSyncInAsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PogoDigitalism%2FSyncInAsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PogoDigitalism","download_url":"https://codeload.github.com/PogoDigitalism/SyncInAsync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PogoDigitalism%2FSyncInAsync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28077395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","concurrency","discord-py","sync","threadpool"],"created_at":"2024-10-12T09:44:42.943Z","updated_at":"2025-12-27T10:07:39.714Z","avatar_url":"https://github.com/PogoDigitalism.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SyncInAsync\n\n## Call synchronous functions in asynchronous coroutines without blocking the event loop! ☑️\n\nEspecially useful for asynchronous libraries like FastAPI, Discord.py etc.\n\n\n## HOW IT WORKS:\n1. SyncInAsync creates a ThreadPoolExecutor (or uses a passed one) to execute these synchronous functions in seperate threads. It also takes the running event loop.\n2. This execution happens through Async IO's run_in_executor.\n3. run_in_executor returns a Future object which is then used to return the Future's result.\n4. This result is the result of your synchronous function!\n\n\n### ⚠️Try to prevent too many threads running concurrently:\n\n*If max_workers is None or not given, it will default to the number of processors on the machine, multiplied by 5, assuming that ThreadPoolExecutor is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for ProcessPoolExecutor.* [concurrent.futures docs](https://docs.python.org/3/library/concurrent.futures.html)\n\n*You can check your amount in Python with **os.cpu_count()***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpogodigitalism%2Fsyncinasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpogodigitalism%2Fsyncinasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpogodigitalism%2Fsyncinasync/lists"}