I think this is possible if I understand what happens under the hood.
I wonder how event loop and async io functions such as
asyncio.open_connection cooperate to do async io in one thread. Maybe it
exploits low-level details and is OS or even device specific. I think I
should take a look at the sou
王珺 wrote:
Suppose io_operation() takes 3 seconds, then how can I write something like
future = io_operation()
print('Start')
time.sleep(1)
print('Something')
time.sleep(2)
print(future.result())
that print 'Start' immediately and the result of io_operation() 3 seconds
later.
Yes, Python can d
On Wed, Feb 24, 2016 at 9:13 AM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Wed, Feb 24, 2016 at 8:23 AM, Marko Rauhamaa wrote:
>>> Tem Pl :
Is there something wrong with this implementation?
>>>
>>> It's a "fork bomb".
>>
>> Isn't that the point of the benchmark?
>
> I don't quite see the
Ian Kelly :
> On Wed, Feb 24, 2016 at 8:23 AM, Marko Rauhamaa wrote:
>> Tem Pl :
>>> Is there something wrong with this implementation?
>>
>> It's a "fork bomb".
>
> Isn't that the point of the benchmark?
I don't quite see the point of the program as it doesn't resemble
anything I'd ever have an
On Wed, Feb 24, 2016 at 8:23 AM, Marko Rauhamaa wrote:
> Tem Pl :
>
>> Here are some concurrency benchmarks for python vs other languages.
>>
>> https://github.com/atemerev/skynet/pull/53
>>
>> Is there something wrong with this implementation?
>
> It's a "fork bomb".
Isn't that the point of the
Tem Pl :
> Here are some concurrency benchmarks for python vs other languages.
>
> https://github.com/atemerev/skynet/pull/53
>
> Is there something wrong with this implementation?
It's a "fork bomb".
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Here are some concurrency benchmarks for python vs other languages.
https://github.com/atemerev/skynet/pull/53
Is there something wrong with this implementation?
"Hope I suck at coroutines, because the results are abysmal.
I get around 63s on my i5 MacBook Air Early 2015. For reference, the go
It seems an event loop is required for all async programs in python, but
sometimes I need only lazy i/o. Is it possible with asyncio?
Suppose io_operation() takes 3 seconds, then how can I write something like
future = io_operation()
print('Start')
time.sleep(1)
print('Something')
time.sleep(2)
See also Doug Hellmann article on asyncio, from its serie of "Python 3
Module of the Week" articles:
https://pymotw.com/3/asyncio/index.html
Victor
2016-02-23 22:25 GMT+01:00 Joao S. O. Bueno :
> Today I also stumbled on this helpful "essay" from Brett Cannon about
> the same subject
>
> http://w
On 24 February 2016 at 02:37, Terry Reedy wrote:
>
> In this essay, Brett says that asyncio added an event loop to Python. It
> did, but it was the second. The tk event loop was added about 20 years ago
> with tkinter.
One of the things I would love to see (but don't have the time to work
on) is
Today I also stumbled on this helpful "essay" from Brett Cannon about
the same subject
http://www.snarky.ca/how-the-heck-does-async-await-work-in-python-3-5
On 23 February 2016 at 18:05, Sven R. Kunze wrote:
> On 20.02.2016 07:53, Christian Gollwitzer wrote:
>
> If you have difficulties wit hthe
On 20.02.2016 07:53, Christian Gollwitzer wrote:
If you have difficulties wit hthe overall concept, and if you are open
to discussions in another language, take a look at this video:
https://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-39-await-co-routines
MS has added coroutine suppo
On 23.02.2016 18:37, Ian Kelly wrote:
It's not entirely clear to me what the C++ is actually doing. With
Python we have an explicit event loop that has to be started to manage
resuming the coroutines. Since it's explicit, you could easily drop in
a different event loop, such as Tornado or curio,
On Tue, Feb 23, 2016 at 9:50 AM, Sven R. Kunze wrote:
> On 23.02.2016 01:48, Ian Kelly wrote:
>>
>> On Mon, Feb 22, 2016 at 3:16 PM, Sven R. Kunze wrote:
>>>
>>> Is something like shown in 12:50 ( cout << tcp_reader(1000).get() )
>>> possible
>>> with asyncio? (tcp_reader would be async def)
>>
>
On 23.02.2016 01:48, Ian Kelly wrote:
On Mon, Feb 22, 2016 at 3:16 PM, Sven R. Kunze wrote:
Is something like shown in 12:50 ( cout << tcp_reader(1000).get() ) possible
with asyncio? (tcp_reader would be async def)
loop = asyncio.get_event_loop()
print(loop.run_until_complete(tcp_reader(1000))
On Mon, Feb 22, 2016 at 3:16 PM, Sven R. Kunze wrote:
> Is something like shown in 12:50 ( cout << tcp_reader(1000).get() ) possible
> with asyncio? (tcp_reader would be async def)
loop = asyncio.get_event_loop()
print(loop.run_until_complete(tcp_reader(1000)))
--
https://mail.python.org/mailman
On 20.02.2016 07:53, Christian Gollwitzer wrote:
If you have difficulties wit hthe overall concept, and if you are open
to discussions in another language, take a look at this video:
https://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-39-await-co-routines
MS has added coroutine suppo
Steven D'Aprano writes:
> "But frankly the stuff I'm seeing in this thread makes me sad for
> *literally every programming language in existence except for Erlang
> and maybe one or two others*, which altogether about six people use in
> total..."
Erlang microtasks are more a matter of the runtim
On Sat, 20 Feb 2016 05:44 pm, Paul Rubin wrote:
> But frankly the stuff I'm seeing in this thread makes me sad for Python.
> It's an impossible dream but it would be awesome to have Erlang-like
> communicating microtasks in Python.
"But frankly the stuff I'm seeing in this thread makes me sad for
On Sat, Feb 20, 2016 at 1:49 AM, Chris Angelico wrote:
> Actually, that mightn't be a bad thing. Maybe raise that as a tracker
> issue? I just tested, and slapping "from __future__ import
> generator_stop" at the top of Lib/asyncio/futures.py causes your
> example to raise an exception instead of
On Sat, Feb 20, 2016 at 1:49 AM, Chris Angelico wrote:
> Definitely seems like it should be fixed, then; the current behaviour
> is that Future.result() raises RuntimeError if you raise
> StopIteration, so having await do the same would make sense.
Future.result() itself simply raises the StopIte
On Sat, Feb 20, 2016 at 7:14 PM, Ian Kelly wrote:
> On Sat, Feb 20, 2016 at 12:57 AM, Chris Angelico wrote:
>> On Sat, Feb 20, 2016 at 6:48 PM, Ian Kelly wrote:
>>> As another point that happens to be fresh in my mind, awaiting a
>>> Future on which an exception gets set is supposed to propagate
On Sat, Feb 20, 2016 at 12:57 AM, Chris Angelico wrote:
> On Sat, Feb 20, 2016 at 6:48 PM, Ian Kelly wrote:
>> As another point that happens to be fresh in my mind, awaiting a
>> Future on which an exception gets set is supposed to propagate the
>> exception. I recently found that this breaks if
On Sat, Feb 20, 2016 at 6:48 PM, Ian Kelly wrote:
> As another point that happens to be fresh in my mind, awaiting a
> Future on which an exception gets set is supposed to propagate the
> exception. I recently found that this breaks if the exception in
> question happens to be StopIteration (grant
On Fri, Feb 19, 2016 at 10:24 PM, Rustom Mody wrote:
> Less snarkily looks like a series of bolt-ons after bolt-ons
>
> IMHO Guido's (otherwise) uncannily sound intuitions have been wrong right from
> 2001 when he overloaded def for generators.
> And after that its been slippery-slope down: reusin
Am 20.02.16 um 03:36 schrieb Steven D'Aprano:
On Thu, 18 Feb 2016 09:08 am, Mark Lawrence wrote:
Seeing there is a lot of interest in asyncio recently I figured people
might be interested in this
http://www.snarky.ca/how-the-heck-does-async-await-work-in-python-3-5
Thanks for the link, but I
Rustom Mody writes:
> Forgot the probably most important: Not merging stackless into CPython
I thought there was some serious technical obstacle to that.
Where can I find Greg Ewing's suggestions about Python coroutines? The
async/await stuff seems ok on the surface.
I liked the Lua paper abou
On Saturday, February 20, 2016 at 10:55:02 AM UTC+5:30, Rustom Mody wrote:
> On Saturday, February 20, 2016 at 8:07:03 AM UTC+5:30, Steven D'Aprano wrote:
> > On Thu, 18 Feb 2016 09:08 am, Mark Lawrence wrote:
> >
> > > Seeing there is a lot of interest in asyncio recently I figured people
> > > m
On Saturday, February 20, 2016 at 8:07:03 AM UTC+5:30, Steven D'Aprano wrote:
> On Thu, 18 Feb 2016 09:08 am, Mark Lawrence wrote:
>
> > Seeing there is a lot of interest in asyncio recently I figured people
> > might be interested in this
> > http://www.snarky.ca/how-the-heck-does-async-await-wor
On Thu, 18 Feb 2016 09:08 am, Mark Lawrence wrote:
> Seeing there is a lot of interest in asyncio recently I figured people
> might be interested in this
> http://www.snarky.ca/how-the-heck-does-async-await-work-in-python-3-5
Thanks for the link, but I'm now no wiser than I was before :-(
Can s
Seeing there is a lot of interest in asyncio recently I figured people
might be interested in this
http://www.snarky.ca/how-the-heck-does-async-await-work-in-python-3-5
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
h
31 matches
Mail list logo