Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: EPICS Python Question
From: <michael.abbott@diamond.ac.uk>
To: <newville@cars.uchicago.edu>
Cc: tech-talk@aps.anl.gov
Date: Wed, 1 Oct 2014 14:34:26 +0000
From: Matt Newville [mailto:newville@cars.uchicago.edu] 
> Out of curiosity, why not use generators and yield as
> coroutines or the asyncio module?   I think that using
> these standard python solutions for coroutines and 
> threads might greatly simplify things for you.

One important difference is that any time an asyncio "coroutine" calls a function (really a generator) that might wish to suspend it will have to use the "yield from" syntax.  This means that 

	x = caget(pv)
	caput(pv, f(x))

would have to be rewritten as

	x = yield from caget(pv)
	yield from caput(pv, f(x))

I suppose this has the advantage of making possible suspension points clearer, but otherwise it looks pretty unsightly to me.  In particular, this means that *any* Python that wishes to perform channel access suddenly needs to transform itself into a generator, which affects how it is called, and so on.

However, asyncio clearly merits a much closer look.


Replies:
RE: EPICS Python Question michael.abbott
References:
EPICS Python Question Elder Matias
Re: EPICS Python Question Kasemir, Kay
Re: EPICS Python Question Shen, Guobao
Re: EPICS Python Question Kasemir, Kay
Re: EPICS Python Question Michael Davidsaver
Re: EPICS Python Question Matt Newville

Navigate by Date:
Prev: Re: EPICS Python Question Matt Newville
Next: RE: EPICS Python Question michael.abbott
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: EPICS Python Question Matt Newville
Next: RE: EPICS Python Question michael.abbott
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·