Steven D'Aprano writes:
> So, I'm, still trying to wrap my brain around async processing, and I
> started reading this tutorial:
>
> http://stackabuse.com/python-async-await-tutorial/
>
> and the very first paragraph broke my brain.
>
> "Asynchronous programming has been gaining a lot of tractio
I have a module below and run it under pdb, the result seems not easy to xplain.
(Note: the sleep periods are in reverse order)
---
# asyncio_as_completed.py
import asyncio
@asyncio.coroutine
def phase(i):
print('in phase {}'.format(i))
yield from asyncio.sleep(0.5 - (0.1 * i)
On 4/4/2018 3:27 AM, Steven D'Aprano wrote:
So, I'm, still trying to wrap my brain around async processing, and I
started reading this tutorial:
http://stackabuse.com/python-async-await-tutorial/
and the very first paragraph broke my brain.
"Asynchronous programming has been gaining a lot of t
>> On 2018-04-04 05:44, Chris Angelico wrote:
>>> On Wed, Apr 4, 2018 at 12:24 PM, sum abiut wrote:
Hi,
Has anyone try this https://pypi.python.org/pypi/julian/0.14
i got this error trying to import julian
>>> import julian
Traceback (most recent call last):
>>>
I got the error below, tryinig in on python 3.2.
import julian
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named julian
On Thu, Apr 5, 2018 at 3:21 AM, Thomas Jollans wrote:
> On 2018-04-04 05:44, Chris Angelico wrote:
> > On Wed, Apr 4, 2018 at 12:24 PM,
On Thu, Apr 5, 2018 at 1:48 AM, Julien Salort wrote:
> Le 04/04/2018 à 14:45, Chris Angelico a écrit :
>> How do you use run_in_executor to turn this asynchronous, and how
>> would this compare to creating one thread for each camera?
>
> This is exactely like creating a thread. Except that I have
On 2018-04-04 05:44, Chris Angelico wrote:
> On Wed, Apr 4, 2018 at 12:24 PM, sum abiut wrote:
>> Hi,
>> Has anyone try this https://pypi.python.org/pypi/julian/0.14
>>
>> i got this error trying to import julian
>>
> import julian
>> Traceback (most recent call last):
>> File "", line 1, in
Le 04/04/2018 à 14:45, Chris Angelico a écrit :
Can you give an example? Let's say we have a simple blocking C function:
int get_data() {
sleep(2);
return 42;
}
I am not saying that I understand 100% and that this is the best way,
but it works for me:
% cat get_data.c
#include
i
On 2018-04-04, 07:27 GMT, Steven D'Aprano wrote:
> I'm no expert, but it seems to me that this has surely got to
> be crazy talk. Whatever task you're doing, processing it
> asynchronously doesn't reduce the amount of work. For example,
> if you want to download ten files, you still have to down
On Wed, Apr 4, 2018 at 10:16 PM, Julien Salort wrote:
> In this case, the script spends most of its time waiting for a frame to be
> available on the cameras, and the time interval to query the other device.
> The fetching and processing of the frames take negligible time. The library
> that I use
Le 04/04/2018 à 09:27, Steven D'Aprano a écrit :
Yes, this exactly. And if you're writing a web app, or certain kinds of
desktop apps, these seems sensible. I don't want my browser to come to a
complete halt just because some resource is taking a few seconds to
respond.
But honestly, from every
On Wed, Apr 4, 2018 at 9:02 PM, Richard Damon wrote:
> Asynchronous processing will use a bit more of some processing resources
> to handle the multi-processing, but it can be more efficient at fully
> using many of the resources that are available.
>
> Take your file download example. When you ar
On Wed, Apr 4, 2018 at 8:42 PM, Paul Moore wrote:
> IMO,
> async has proved useful for handling certain types of IO bound
> workloads with lower overheads[1] than traditional multi-threaded or
> multi-process designs. Whether it's a good fit for any particular
> application is something you'd have
On 4/4/18 3:27 AM, Steven D'Aprano wrote:
> So, I'm, still trying to wrap my brain around async processing, and I
> started reading this tutorial:
>
> http://stackabuse.com/python-async-await-tutorial/
>
> and the very first paragraph broke my brain.
>
> "Asynchronous programming has been gaining
On Wed, Apr 4, 2018 at 5:27 PM, Steven D'Aprano
wrote:
> So, I'm, still trying to wrap my brain around async processing, and I
> started reading this tutorial:
>
> http://stackabuse.com/python-async-await-tutorial/
>
> and the very first paragraph broke my brain.
>
> "Asynchronous programming has
On 4 April 2018 at 08:27, Steven D'Aprano
wrote:
> "Asynchronous programming has been gaining a lot of traction in the past
> few years, and for good reason. Although it can be more difficult than
> the traditional linear style, it is also much more efficient."
>
> I can agree with the first part
On 4 Apr 2018, at 9:27, Steven D'Aprano wrote:
Its as hard to wrap your brain around as parallel processing in
general,
but with even worse performance than sequential processing.
Am I totally wrong?
I would say that it all depends on what kind of stuff you're doing. I'm
no scheduling exper
Here is my code:
import pyaudio
tim=1
chunk = 8
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 5
p = pyaudio.PyAudio()
s = p.open(format = FORMAT,channels = CHANNELS,rate = RATE,input =
True,output=True,frames_per_buffer = chunk)
d=[]
print((RATE // chunk
I agree with you.
Async IO is more efficient than threading for **waiting** I/O.
When there are thousands of idle connections, async I/O is best idea.
On the other hand, async I/O uses more system calls for busy I/O.
For example, when building chat application which handles thousands
WebSocket c
So, I'm, still trying to wrap my brain around async processing, and I
started reading this tutorial:
http://stackabuse.com/python-async-await-tutorial/
and the very first paragraph broke my brain.
"Asynchronous programming has been gaining a lot of traction in the past
few years, and for good
20 matches
Mail list logo