Digging	Into	asyncio
BEFORE TO GO…
- socket knowledge
- I/O Model: Multiplexing I/O
- python: generator, coroutine, future, task
SOCKET
I/O MODELS
I/O MULTIPLEXING
PYTHON MODULES
• generator
Create yield keyword. A function that produces a sequence of results instead of a single value.

• coroutine
Basically generator with “yield from” keyword. Able to create generators inside generators that just like a
tunnel, pass the data back and forth from the inner-most to the outer-most generators. Coroutines are
functions that can be stopped and resumed while being run.

• future
A design for a package that facilitates the evaluation of callables using threads and processes. Futures
are objects that have the __await__() method implemented, and their job is to hold a certain state and
result. 

• task
A special futures, which wrap around coroutines, responsible for executing a coroutine object in an event loop.
SEE THE CODE
https://github.com/MJ111/concurrencylive
UVLOOP(LIBUV)

Digging into asyncio

  • 1.
  • 2.
    BEFORE TO GO… -socket knowledge - I/O Model: Multiplexing I/O - python: generator, coroutine, future, task
  • 3.
  • 4.
  • 5.
  • 6.
    PYTHON MODULES • generator Createyield keyword. A function that produces a sequence of results instead of a single value. • coroutine Basically generator with “yield from” keyword. Able to create generators inside generators that just like a tunnel, pass the data back and forth from the inner-most to the outer-most generators. Coroutines are functions that can be stopped and resumed while being run. • future A design for a package that facilitates the evaluation of callables using threads and processes. Futures are objects that have the __await__() method implemented, and their job is to hold a certain state and result. • task A special futures, which wrap around coroutines, responsible for executing a coroutine object in an event loop.
  • 7.
  • 8.