-
Notifications
You must be signed in to change notification settings - Fork 55
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
async wrapper #23
Comments
@eve-alt. feel free to implement it. What would be the benefit of having an async wrapper? That you could include in async Python projects? I'm not really familiar with async in Python. It seems it was invented to speed up an application and to not have blocking threads, am I right? Anyway, once your done, we can reference your wrapper in our readme/website. Or if you want we can include it under the PokeAPI org. |
That sounds wonderful eve-alt! Will you be submitting this as an update to pokebase (so that users who want a python wrapper can download pokebase and then choose if they want synchronous/asynchronous operation), or will this be a separate module (like pokebase-async or whatever you want to name it)? |
hi, i think you misunderstood what i said, i just referenced another command made by someone else as i was asking if he already released it since a year has passed already. |
Oh, Now I get it! I'll format your issue properly. To answer your question: no nothing has been released. But feel free to do it, if you got inspired by our excitement 😸 |
I decided to try and practice some python and attempt to make the async wrapper. I made a branch in my fork here. I didn't change any original code, so you can still use it as synchronous code, and instead made the functions/classes as async. It seems to work, although I don't know much about python asynchronous testing so I haven't made any tests for it 😅. You can try it out by starting an event loop and calling the async functions, like so:
I hope one of you can give it a try and let me know what you think 😄. |
Not a Python expert also on my side. I'll give it a try if @Kronopt cannot take a look at it :) |
I just brushed over the code and it looks good, @C-Garza! I just have one comment: This way you have the requirements for both implementations of pokebase (async and regular) on the same package. That might not be ideal. To test aiohttp requests you could try aioresponses. |
Yeah I quickly realized that I would basically have to keep separate async versions of the code, but kept them in the same files for now. So @Kronopt, would you suggest that async changes be added as a separate module like I guess I have to learn some async python testing now 😅. |
Hi boys, in case you are wondering, we can have a separate project nested in the PokeAPI org. We can use I'd opt for a new one. |
@C-Garza a separate module would be best yes, in my opinion |
Hi! I just wanted to tell that I made an async wrapper for the pokeapi, you can find it here. |
Hi! Sorry, I ended up not going very far with it because I stopped working on the project that needed the wrapper... I should have posted an update on that issue, apologies :/ |
Howdy there!
hi, as I was reading thru issues I saw ur reply and thought that hey, a year already passed and was just thinking if it was released already and I didn't know about it. I also tried googling
pokebase-async
and didn't see anything that I was looking for so, I'd like to ask if the async wrapper will be really a thing.The text was updated successfully, but these errors were encountered: