Skip to content

Commit b69dfe6

Browse files
committed
Updated README with asyncclick details
1 parent 181337a commit b69dfe6

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,28 @@ Hello, Click!
5353
Hello, Click!
5454
```
5555

56+
## Differences to Click
57+
58+
This async-ized version of Click is mostly backwards compatible for "normal" use:
59+
you can freely mix sync and async versions of your command handlers and callbacks.
60+
61+
Several advanced methods, most notably :meth:`BaseCommand.main`, and
62+
:meth:`Context.invoke`, are now asynchronous.
63+
64+
The :meth:`BaseCommand.__call__` alias now invokes the main entry point via
65+
`anyio.run`. If you already have an async main program, simply use
66+
``await cmd.main()`` instead of ``cmd()``.
67+
68+
:func:`asyncclick.prompt` is asyncronous and accepts a ``blocking`` parameter
69+
that switches between "doesn't affect your event loop but has unwanted effects when
70+
interrupted" (bugfix pending) and "pauses your event loop but is safe to interrupt"
71+
with Control-C". The latter is the default until we fix that bug.
72+
73+
You cannot use Click and AsyncClick in the same program. This is not a problem
74+
in practice, as replacing ``import click`` with ``import asyncclick as click``, and
75+
``from click import ...`` with ``from asyncclick import ...``, should be all that's
76+
required.
77+
5678

5779
## Donate
5880

@@ -64,8 +86,6 @@ donate today][].
6486
[please donate today]: https://palletsprojects.com/donate
6587

6688
The AsyncClick fork is maintained by Matthias Urlichs <matthias@urlichs.de>.
67-
It's not a lot of work, so if you'd like to motivate me, donate to the
68-
charity of your choice and tell me that you've done so. ;-)
6989

7090
## Contributing
7191

0 commit comments

Comments
 (0)