Experimental Physics and Industrial Control System
From: Matt Newville [mailto:[email protected]]
> 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
<2014>
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- 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
<2014>
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024