The API has been overhauled in order to provide 2 different ways of doing things:
A synchronous API, which will spawn a green thread and wait for it for every request sent this way
An asynchronous API, which just prepares the requests, allowing the user to throttle them with map or imap
Another important improvement is that when sending requests with map/imap, if one of them fails with an error, the exception object is returned, instead of raising it and stopping the process in the middle.
Here is an example script showing both APIs:
Last but not least, I’d like to thank Juan Riaza for his help in designing the API and adapting the tests. 🙂
I’ve been working on-and-off on this project for almost a year during my free time, and after meditating about it I thought: “fuck it, ship it”. Allow me to introduce Evergreen: cooperative multitasking and i/o for Python.
“So, another framework?” I hear you say. Yes, it’s another async framework. But it’s my async framework. I’ve used a number of frameworks for developing servers in Python such as Twisted, Tornado, Eventlet, Gevent and lately Tulip and all of them have great and not so great things, so I decided to blend the ideas I gathered from all of them, add some opinionated decisions, some Stackless flavour and Evergreen was the result.
Evergreeen is a framework which allows developers to write synchronous looking code which is executed asynchronously in a cooperative manner. Evergreen presents an API which looks like the one you would use to write concurrent programs using threads or futures from the Python standard library. The facilities provided by Evergreen are however cooperative, that is, while a task is busy waiting for some i/o other tasks will have their chance to run.
“Is it production ready?” I hear you say. It’s still on a very early stage, but I believe the foundation is solid. However, the APIs provided by Evergreen may change a bit until I feel confortable with them. All feedback is welcome, so if you give it a try do let me know!
I’d like to thank all authors of similar libraries for releasing their work as Open Source which I could look into and learn from.
I hope Evergreen can help you solve some problems and you enjoy using it as much as I do developing it.