3 ms·
> python you can trick generators into turning synchronous-looking code into asynchronous Example: http://dieselweb.org/lib/ http://dieselweb.org/lib/ or https
by viraptor 16y ago
> python you can trick generators into turning synchronous-looking code into asynchronous
Example: http://dieselweb.org/lib/ http://dieselweb.org/lib/ or https://github.com/saucelabs/monocle https://github.com/saucelabs/monocle
Although Diesel2 is much more interesting, with greenlets support. No more messing about with `yield`, since the blocking functions themselves force a context switch. https://github.com/jamwt/diesel https://github.com/jamwt/diesel
- tomn 16y agoThat looks really interesting, though it seems a bit dangerous -- greenlet feels like a bit of a hack. I wish I'd found diesel before twisted; it seems a lot more elegant if you don't need any of the built-in protocols. The twisted model is good, there's just too much of it.