
On 07/01/2015 01:56 AM, Nick Coghlan wrote:
On 1 July 2015 at 14:25, Ron Adam<ron3200@gmail.com> wrote:
That's really very nice. Are there advantages to asyncio over the multiprocessing module?
I find it most useful to conceive of asyncio as an implementation of an "event driven programming" development paradigm.
It makes since to think of events as IO. Then on top of that, have some sort of dispatch mechanism, which could be objective, imperative, or functional. A robot control program would be a good practical example to use to test these things. I think it's a good direction for python to go in. They need to process multiple sensor inputs, and control multiple external devices all at the same time. I think anything that makes that easier will be good. (It is the future.)
P.S. It *is* possible to implement the "imperative shell, event driven core" model, but it requires a synchronous-to-asynchronous adapter like gevent, or an event-loop-per-thread model and extensive use of "run_until_complete()". It's much more complex than "just use concurrent.futures".
I'm not sure what a event driven core is exactly. It seems to me it would be an event driven (functional, objective, imperative) core. The closest thing I can think of that wouldn't be one of those would be a neural net. Of course it may also be a matter of how we choose to think of things. It's quite possible to have many layers of imperative, functional, and objective, on top of each other. Then we need to indicate the part of the program we are referring to as being X shell/Y core. Cheers, Ron