Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81458 > unrolled thread

Re: Basic asyncio usage

Started byBenjamin Risher <brisher777@gmail.com>
First post2014-11-24 07:18 -0800
Last post2014-11-25 13:57 -0500
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Basic asyncio usage Benjamin Risher <brisher777@gmail.com> - 2014-11-24 07:18 -0800
    Re: Basic asyncio usage Marko Rauhamaa <marko@pacujo.net> - 2014-11-24 18:26 +0200
      Re: Basic asyncio usage Benjamin Risher <brisher777@gmail.com> - 2014-11-25 06:33 -0800
        Re: Basic asyncio usage Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-25 13:57 -0500

#81458 — Re: Basic asyncio usage

FromBenjamin Risher <brisher777@gmail.com>
Date2014-11-24 07:18 -0800
SubjectRe: Basic asyncio usage
Message-ID<977ab162-feba-4320-9c5c-373015c84874@googlegroups.com>
On Wednesday, March 26, 2014 6:35:31 AM UTC-5, Piotr HusiatyƄski wrote:
> Hi,
> I have posted the same question to python-tutor list *, but I'm trying
> my luck here as advised.
> 
> I'm trying to get more familiar with asyncio library. Using python
> 3.4, I wrote simple echo server (see attachement for the code). I know
> that instead of using bare bone send/recv I could use some of the
> helper functions, but I want to start with the basics.
> 
> Using attached code, I can connect from multiple sources, but echo
> won't work for all clients. Also, please look at the `sendall` mehtod
> - I have to manually remove write callback, otherwise it will be
> called all the time. Any tips on solving this problem?
> 
> * https://mail.python.org/pipermail/tutor/2014-March/100679.html

Hello, 

I was wondering if you ever made progress with your asyncio project.  I'm currently digging around for examples and reference material and came across your post.

I'd be interested in any tips/gotchas/examples you'd be willing to provide as far as asyncio.  

Thanks!

[toc] | [next] | [standalone]


#81461

FromMarko Rauhamaa <marko@pacujo.net>
Date2014-11-24 18:26 +0200
Message-ID<87ppcch8eh.fsf@elektro.pacujo.net>
In reply to#81458
Benjamin Risher <brisher777@gmail.com>:

> I was wondering if you ever made progress with your asyncio project.
> I'm currently digging around for examples and reference material and
> came across your post.
>
> I'd be interested in any tips/gotchas/examples you'd be willing to
> provide as far as asyncio.

Here's an implementation of the classic Dining Philosophers problem:

   <URL: http://pacujo.net/~marko/philosophers.py>

The main object of the example is to see how multiple inputs can be
multiplexed using asyncio.wait(FIRST_COMPLETED).


Marko

[toc] | [prev] | [next] | [standalone]


#81513

FromBenjamin Risher <brisher777@gmail.com>
Date2014-11-25 06:33 -0800
Message-ID<50b6968a-e521-4209-8c00-81b7e00e56f8@googlegroups.com>
In reply to#81461
On Monday, November 24, 2014 10:26:42 AM UTC-6, Marko Rauhamaa wrote:
> Benjamin Risher <brisher777@gmail.com>:
> 
> > I was wondering if you ever made progress with your asyncio project.
> > I'm currently digging around for examples and reference material and
> > came across your post.
> >
> > I'd be interested in any tips/gotchas/examples you'd be willing to
> > provide as far as asyncio.
> 
> Here's an implementation of the classic Dining Philosophers problem:
> 
>    <URL: http://pacujo.net/~marko/philosophers.py>
> 
> The main object of the example is to see how multiple inputs can be
> multiplexed using asyncio.wait(FIRST_COMPLETED).
> 
> 
> Marko

Marko, 

Thank you for the reply.  I've never heard of the Dining Philosophers problem until now.  After reading up on it, I can see why it comes up when talking about concurrent programming.  I'll add this to my list of examples to dig through.  

Ben

[toc] | [prev] | [next] | [standalone]


#81523

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2014-11-25 13:57 -0500
Message-ID<mailman.16292.1416941883.18130.python-list@python.org>
In reply to#81513
On Tue, 25 Nov 2014 06:33:57 -0800 (PST), Benjamin Risher
<brisher777@gmail.com> declaimed the following:

>Thank you for the reply.  I've never heard of the Dining Philosophers problem until now.  After reading up on it, I can see why it comes up when talking about concurrent programming.  I'll add this to my list of examples to dig through.  

Ack... When the second edition of Ben-Ari
http://www.amazon.com/Principles-Concurrent-Distributed-Programming-Edition/dp/032131283X/ref=dp_ob_image_bk
is $150 dollars, I'm not surprised... I have the first edition from decades
ago, when it was under $30 as I recall.

	Seems all the other generic theory books have faded away too, leaving
the "doing something with language du jure" stuff...

	Even
http://www.amazon.com/Communicating-Sequential-Processes-International-Computing/dp/0131532715/ref=sr_1_1?ie=UTF8&qid=1416941700&sr=8-1&keywords=communicating+sequential+processes&pebp=1416941713826
looks over priced and its ancient...
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web