On Tue, 24 Dec 2013 00:43:51 +0100
Tobias Oberstein
<[email protected]> wrote:
> Am 23.12.2013 23:29, schrieb Antoine Pitrou:
> > On Mon, 23 Dec 2013 23:25:58 +0100
> > Tobias Oberstein
> > <[email protected]> wrote:
> >>>> In short: I can't call a coroutine from data_received, but I can call an
> >>>> inlineCallbacks-decorated functions in dataReceived. This is a major
> >>>> difference.
> >>>
> >>> I'm willing to bet that you're doing something wrong here. Can you post
> >>> code snippets?
> >>
> >> http://stackoverflow.com/questions/20746619/calling-coroutines-in-asyncio-protocol-data-received
> >
> > I think you should instead write your coroutine as a separate function
> > or method and then schedule it from data_received() using e.g.
> > asyncio.async().
> 
> I can't see how that would help with "yield from" proliferation. I guess 
> I can sum up my issue like this:
> 
> If I want users to be able to write their app level protocol handlers as 
> coroutines, that means I have to use "yield from" everywhere inside my 
> framework.

No, that doesn't mean that. Did you misunderstand what I wrote?

Regards

Antoine.


Reply via email to