Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncio #758

Open
tony opened this issue Mar 15, 2022 · 0 comments
Open

asyncio #758

tony opened this issue Mar 15, 2022 · 0 comments
Assignees

Comments

@tony
Copy link
Member

tony commented Mar 15, 2022

After adding sleep_after / sleep_before in #750 we need a way to sleep asynchronously

Example from this convo: pallets/click#85 (comment)

import asyncio
from functools import wraps

def coro(f):
    @wraps(f)
    def wrapper(*args, **kwargs):
        return asyncio.run(f(*args, **kwargs))

    return wrapper

Usage:

@click.command()
@coro
async def command():
    await asyncio.sleep(1)
    click.echo("Delayed hello")
@tony tony added this to tmuxp Mar 20, 2022
@tony tony added this to the Milestone 1.13 milestone Mar 20, 2022
@tony tony self-assigned this Mar 20, 2022
@tony tony moved this to Todo in tmuxp Mar 20, 2022
@tony tony modified the milestones: Milestone 1.13, Milestone 1.14 May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant