notion / a_sync Goto Github PK
View Code? Open in Web Editor NEWAn async helper library for Python's async functionality.
License: Apache License 2.0
An async helper library for Python's async functionality.
License: Apache License 2.0
convert XXX
comments to real issues.
remove workarounds for partials caused by mypy's python/mypy#1484
Document the example code in the README.
make the async_foo
functions just foo
- as this is an async library, the async versions should come first.
make the current foo
functions sync_foo
.
sometimes all you want to do is run a function and timeout.
allow the user to provide an error-return to be returned. if none provided, raise the standard exceptions.
Not exactly sure why, but event loops started clashing resulting in asyncio to freak out. This is a workaround for that:
index b255b40..a45f001 100644
--- a/test_automation/interactors/alexa/__init__.py
+++ b/test_automation/interactors/alexa/__init__.py
@@ -10,6 +10,8 @@ import time
import pathlib
import logging
import traceback
+import asyncio
+from threading import Thread
# [ -Third Party ]
import a_sync
import blessed
@@ -148,7 +150,14 @@ async def _auth_user_to_avs(*, username, password) -> dict:
# run and block till complete
logger.info("Running auth server/client...")
- server_and_client.block()
+
+ def thread_target():
+ return asyncio.new_event_loop().run_until_complete(server_and_client.run())
+
+ thread_1 = Thread(target=thread_target)
+ thread_1.start()
+
+ thread_1.join()
# return the retrieved tokens.
return auth_server.TOKENS
And here is more info: https://stackoverflow.com/questions/42546099/python-asyncio-migrate-from-3-4-to-3-5
The current syntax is really verbose, but not really clear. That needs to be fixed. There's also a lot of unnecessary duplication between the async/sync versions of things.
Also, the code currently sometimes starts awaitables before the user calls the actual parallel/serial partial to do the full execution - stop doing that.
add static checkers and config files, and update the code accordingly.
via travis or circle CI.
mypy is now supporting async/await syntax, so use it during static checking!
asyncio and the await syntax in general deals with asyncio futures. This library so far deals with those, with async functions, and with normal functions. Integrate concurrent.futures as a handled object type.
get this thing installable via pip!
open specific defensive coding issues for functions lacking good defensive code.
update/replace/re-write the background functions and waiting functions to do the right thing for:
... in both async and sync contexts.
Document what this library is for in terms of why it was written.
This started as a throw-away experimentation file, turned into a gist, expanded into a local private repo, split into several files, and now has been published as a public repo. It's time to update it to a real python project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.