{"id":13813596,"url":"https://github.com/kennethreitz/background","last_synced_at":"2025-05-15T00:33:38.245Z","repository":{"id":57413650,"uuid":"331079234","full_name":"kennethreitz/background","owner":"kennethreitz","description":"Runs things in the background. ","archived":false,"fork":true,"pushed_at":"2022-04-12T19:31:56.000Z","size":20,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-19T10:18:17.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ParthS007/background","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kennethreitz.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"ParthS007","patreon":"parthshandilya","ko_fi":"parthshandilya"}},"created_at":"2021-01-19T18:55:47.000Z","updated_at":"2024-09-05T21:48:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kennethreitz/background","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethreitz%2Fbackground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethreitz%2Fbackground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethreitz%2Fbackground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethreitz%2Fbackground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kennethreitz","download_url":"https://codeload.github.com/kennethreitz/background/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225319279,"owners_count":17455740,"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","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":[],"created_at":"2024-08-04T04:01:22.529Z","updated_at":"2024-11-19T08:30:47.279Z","avatar_url":"https://github.com/kennethreitz.png","language":null,"funding_links":["https://github.com/sponsors/ParthS007","https://patreon.com/parthshandilya","https://ko-fi.com/parthshandilya"],"categories":["Python"],"sub_categories":[],"readme":".. image:: https://img.shields.io/pypi/pyversions/background.svg\n   :target: https://pypi.org/pypi/background\n\n.. image:: https://github.com/ParthS007/background/workflows/CI/badge.svg\n   :target: https://github.com/ParthS007/background/actions\n\nBackground\n=======================================\n\nIt runs stuff in the background.\n\n    \"An elegant decorator-based abstraction around Python 3's concurrent.futures ThreadPoolExecutor class\" \n\n    — Simon Willison\n\nThis module makes it stupidly simple to run things in the background of your\napplication, be it a CLI app, or a web app.\n\nBasic Usage\n-----------\n\n.. code:: python\n\n\n    import time\n\n    import background\n\n\n    @background.task\n    def work():\n        # Do something expensive here.\n        time.sleep(10)\n\n\n    for _ in range(100):\n        work()\n\n\nAdvanced Usage\n--------------\n\n.. code:: python\n\n    import time\n\n    import background\n\n    # Use 40 background threads.\n    background.n = 40\n    \n\n    @background.task\n    def work():\n        time.sleep(10)\n        return \"Done!\"\n\n    @background.callback\n    def work_callback(future):\n        print(future.result())\n\n\n    for _ in range(100):\n        work()\n\nInstallation\n------------\n\n::\n\n    $ pipenv install background\n    ✨🍰✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethreitz%2Fbackground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennethreitz%2Fbackground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethreitz%2Fbackground/lists"}