saghul / evergreen Goto Github PK
View Code? Open in Web Editor NEWCooperative multitasking and i/o for Python
Home Page: https://pypi.python.org/pypi/evergreen
License: MIT License
Cooperative multitasking and i/o for Python
Home Page: https://pypi.python.org/pypi/evergreen
License: MIT License
Hi saghul,
I've just installed evergreen to have a look and perform basic tests:
cat /etc/issue
Ubuntu 14.04.1 LTS
pip install evergreen
Downloading evergreen-0.1.0.tar.gz
Downloading fibers-0.4.0.tar.gz
Downloading pyuv-1.0.1.tar.gz
but I've been stopped at first step:
python
import evergreen
loop=evergreen.EventLoop()Traceback (most recent call last):
File "", line 1, in
File "/home/francois/.local/share/virtualenvs/py2/local/lib/python2.7/site-packages/evergreen/core/loop.py", line 126, in init
self._ready_processor.unref()
AttributeError: 'pyuv.Check' object has no attribute 'unref'
I thought probably an evergreen/pyuv version mismatch :)
But now that I checked, there seems to be a single version of pyuv available on pypi:
pip install yolk
yolk -V pyuvpyuv 1.0.1
If you can have a look ?
François
when i using evergreen == 0.1.0 , i install it with pip
pip install evergreen
and it install pyuv == 1.3.0, and it try this example:
#!/usr/bin/env python
# encoding: utf-8
import evergreen
# Create the global loop
loop = evergreen.EventLoop()
# Start the loop
loop.run()
it get following error:
Traceback (most recent call last):
File "test.py", line 7, in <module>
loop = evergreen.EventLoop()
File "/home/yetship/.virtualenvs/evergreen/lib/python2.7/site-packages/evergreen/core/loop.py", line 126, in __init__
self._ready_processor.unref()
AttributeError: 'pyuv._cpyuv.Check' object has no attribute 'unref'
I really dislike the complete future approach in evergreen. Generally the concept is great (compared to callback passing style), but in this case you are mixing two programming models: greenlets vs. futures.
I would like to see that threads and processes have the same interface than a task. So you would do:
t = loop.spawn_[task|thread|process](func, *args, **kwargs)
t.join()
t.result
t.get() # shortcut to join + result
p = loop.spawn_ext_process(cmd_args, stdout=True)
for line in p.stdout:
print line
Internally you should use libuv's thread pool and process capabilities which should be more efficient than the concurrent.futures implementation.
Hi there,
I'm using Evergreen in a project of mine, and I'm running into a strange edge case. Long story short, I need to read from a TUN/TAP device on Mac OS X. If you do pretty much anything except calling select() on the device, you get errno = 35. So, I tried calling select() from a regular Thread, reading the data that shows up, and then putting it on a queue (see here). However, I get an RuntimeError('there is no event loop created in the current thread')
, which makes sense. However, I don't know of any other way to do this - sending data to a task from another thread without blocking the entire event loop. Any suggestions?
Thanks!
There are multiple test cases dead-locking on Windows:
Any idea?
test_udp_ping_pong (test_io.IOTests) ... Traceback (most recent call last):
File "../evergreen\core\loop.py", line 372, in _process_ready
handler._run()
File "../evergreen\core\loop.py", line 47, in _run
self._callback(*self._args, **self._kwargs)
File "../evergreen\locks.py", line 58, in _notify_waiters
waiter.switch()
File "../evergreen\tasks.py", line 135, in __run
self.run()
File "../evergreen\tasks.py", line 87, in run
self._target(*self._args, **self._kwargs)
File "c:\Users\schlaich\Documents\GitHub\evergreen\tests\test_io.py", line 178, in connect
client.send(b'PING', TEST_SERVER)
File "../evergreen\io\udp.py", line 42, in send
f.get()
File "../evergreen\futures\_base.py", line 341, in get
return self._get_result()
File "../evergreen\futures\_base.py", line 356, in _get_result
raise self._exception
UDPError: (6, 'address not available')
Hi,
Just find out that in your documentation, the design part, it mentioned that the Task class is implemented using the greenlet library.
But in the tasks.py, the Task class is using python-fibers instead of greenlet.
I think some people will be confused when reading the document and tracing the source code.
Just to notify this small issue, not sure it is the right place to report this.
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.