Evergreen 0.2.0 released!

I’m very happy to announce I just released evergreen 0.2.0! From the API standpoint, not many things changed, but a number of important internal changes happened, including a change in how callbacks are scheduled in the event loop, which fixed a nasty issue in Windows.

For those who may not know:

Evergreen is a cooperative multitasking and i/o library for Python. It provides equivalent primitives to those for thread programming, but uses a cooperative model instead.

Operations are driven by an event loop which will run the given tasks and i/o operations in a non-blocking manner while presenting the user a synchronous, blocking API.

Here is the full changelog:

 – Revert “Don’t allow futures to be used more than once”
 – Break potential cycle because we are storing the traceback
 – Fixed passing traceback when propagating exception to MAIN parent
 – Process all callbacks using an Idle handle
 – Replaced use of Future in io module for Result
 – Don’t wait for send operation to complete in UDPEndpoint
 – Always run tests from the right directory
 – Fix UDP test case on Windows
 – Added flush() method to UDPEndpoint and Stream objects
 – Cache sockname and peername properties
The code can be downloaded from GitHub, as usual. Hope you like it!
:wq

Evergreen 0.0.4 released!

It’s been a while since I haven’t posted around here! I made a few evergreen releases which are probably worth mentioning. They are pretty minor, no big changes have happened. The module which got most of the work is the io module, which I expect to improve more, as well as add cooperative UDP, TLS and file I/O support.

In addition, I created a couple of packages extending evergren’s functionality:

If you are using evergeen, let me know! Hopefully I can continue to make it better bit by bit.

:wq

 

Evergreen: cooperative multitasking and i/o for Python

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.

standards

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.

“Show me the code!” I hear you say. Sure, it’s up here on GitHub, released under the MIT license. Since the usual example is a web crawler, here you have one.

Did I mention it supports Python 2 and 3?

“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.

:wq