Если кому будет полезно - решение задачи, учитывая ответ
Dr.Baconfrom aiohttp import web
import json
import asyncio
import logging
import os
async def handle(request):
name = request.match_info.get('name', "Anonymous")
text = "Hello, " + name
return web.Response(text=text)
async def checkfile():
while True:
print("ho! ho! ho!")
await asyncio.sleep(5)
async def on_startup(app):
app.loop.create_task(checkfile())
pass
server = web.Application()
server.on_startup.append(on_startup)
server.add_routes([web.get('/', handle)])
if __name__ == '__main__':
web.run_app(server,port=8888)