# import threading
# import asyncio
#
#
# async def hello():
#     print('Hello world! (%s)' % threading.currentThread())
#     await asyncio.sleep(1)
#     print('Hello again! (%s)' % threading.currentThread())
#
#
# loop = asyncio.get_event_loop()
# tasks = [hello(), hello()]
# loop.run_until_complete(asyncio.wait(tasks))
# loop.close()


# def consumer():
#     r = ''
#     while True:
#         n = yield r
#         if not n:
#             return
#         print('[CONSUMER] Consuming %s' % n)
#         r = '200 OK'
#
#
# def produce(c):
#     c.send(None)
#     n = 0
#     while n < 5:
#         n = n + 1
#         print('[PRODUCER] Producing %s' % n)
#         r = c.send(n)
#         print('[PRODUCER] Consumer return: %s' % r)
#     c.close()
#
#
# c = consumer()
# produce(c)

# 3.6
import asyncio


async def hello_world():
    print("Hello World! 23456789")


loop = asyncio.get_event_loop()
# Blocking call which returns when the hello_world() coroutine is done
loop.run_until_complete(hello_world())
loop.close()

# import threading
# import asyncio
#
#
# async def hello():
#     print('Hello world! (%s)' % threading.currentThread())
#     await asyncio.sleep(1)
#     print('Hello again! (%s)' % threading.currentThread())
#
#
# loop = asyncio.get_event_loop()
# tasks = [hello(), hello()]
# loop.run_until_complete(asyncio.wait(tasks))
# loop.close()


# def consumer():
#     r = ''
#     while True:
#         n = yield r
#         if not n:
#             return
#         print('[CONSUMER] Consuming %s' % n)
#         r = '200 OK'
#
#
# def produce(c):
#     c.send(None)
#     n = 0
#     while n < 5:
#         n = n + 1
#         print('[PRODUCER] Producing %s' % n)
#         r = c.send(n)
#         print('[PRODUCER] Consumer return: %s' % r)
#     c.close()
#
#
# c = consumer()
# produce(c)

# 3.6
import asyncio


async def hello_world():
    print("Hello World! 23456789")


loop = asyncio.get_event_loop()
# Blocking call which returns when the hello_world() coroutine is done
loop.run_until_complete(hello_world())
loop.close()

# import threading # import asyncio # # # async def hello(): #     print('Hello world! (%s)' % threading.currentThread()) #     await asyncio.sleep(1) #     print('Hello again! (%s)' % threading.currentThread()) # # # loop = asyncio.get_event_loop() # tasks = [hello(), hello()] # loop.run_until_complete(asyncio.wait(tasks)) # loop.close() # def consumer(): #     r = '' #     while True: #         n = yield r #         if not n: #             return #         print('[CONSUMER] Consuming %s' % n) #         r = '200 OK' # # # def produce(c): #     c.send(None) #     n = 0 #     while n < 5: #         n = n + 1 #         print('[PRODUCER] Producing %s' % n) #         r = c.send(n) #         print('[PRODUCER] Consumer return: %s' % r) #     c.close() # # # c = consumer() # produce(c) # 3.6 # Blocking call which returns when the hello_world() coroutine is done