-
Notifications
You must be signed in to change notification settings - Fork 10
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
Adding Async Capabilities to all decorators #16
Conversation
So the failing tests are all regarding type hinting |
Thanks for looking into this! This is definitely a useful addition. Some remarks:
|
@koenvervloesem Furthermore i wanted to ask if it's okay to import the modules from typing directly instead of having to write |
Importing directly from the When looking at the code now, and considering the issue with non-async methods, I wonder if we don't make this too complicated to maintain by trying to support both async and non-async methods in the decorators. Maybe we should just drop the possibility to decorate non-async methods? What do you think? |
I would support this,especially considering that by enableing async only, the probabilty of people using async libraries and therefore improving parallel processing aswell as more efficient runtime usage. And people don't have to use the features of asyncio if they don't want to. I think this should be decided as early as possible before more apps start using this library. |
Ok, I agree, let's just do this breaking change now before more people are using the library. Can you remove the non-async code and typing hints from the parts in the code you touched? I'll fix the documentation, examples and tests in the tests directory afterwards, and then I'll publish a new release. |
is there a reason why some End/ContinueSessions are stringified instead of accepting the classes as returns? e.g. |
These are forward declarations referring to a class that is defined only after this code in the file. It could be that I haven't fixed these everywhere yet. But in the mean time I have moved these simple helper classes forward in the file so that we don't have this problem anymore: 6c42306. |
i forgot to pull the new master version and had some issues but they are all resolved now @koenvervloesem. |
Thanks, I'll have a look! |
Ok I merged your pull request, tested the example apps and I cleaned up the examples and documentation. Could you take a look at master and let me know if you see some problems? If it looks fine for you, I'll create a new release then. |
I went through the docs and it all seems fine. Maybe at least until the next release we should have a banner like section explaining that the |
Hi there 👋
By adding support for async functions, more actions can be handled in a shorter amount of time, especially when using APIs.
The needed additions are very short. I tested all but the Hotword decorator but i assume that it will function the same way.
Using async or normal functions doesn't make any difference on the library side anymore.
I added a hint in the
Usage
docs but maybe this needs to be referenced somewhere else.