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


Groups > comp.lang.python > #5647

Re: in search of graceful co-routines

References <4DD2AA99.3010508@simplistix.co.uk>
Date 2011-05-18 12:50 +1000
Subject Re: in search of graceful co-routines
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1739.1305687011.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, May 18, 2011 at 3:04 AM, Chris Withers <chris@simplistix.co.uk> wrote:
> Hi All,
>
> I'm looking for a graceful pattern for the situation where I have a provider
> of a sequence, the consumer of a sequence and code to moderate the two, and
> where I'd like to consumer to be able to signal to the provider that it
> hasn't succeeded in processing one element in the queue.

I wonder would this work nicely if concepted as a couple of threads
with a Queue between them? Whether or not you actually use threads per
se, or if you just have two separate processing loops and message
passing between them, it might be easier to code that way than as
generators.

Chris Angelico

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: in search of graceful co-routines Chris Angelico <rosuav@gmail.com> - 2011-05-18 12:50 +1000

csiph-web