The server is written on aiohttp web.
The server is the intermediary between the database and mobile applications. You need to add the update to the server every n seconds came to a certain web page, and under certain conditions called another function. However, he must continue to accept requests from mobile.
I implemented this idea in the following way:
from aiohttp import web
async def handle(request):
name = request.match_info.get('name', "Anonymous")
text = "Hello," + name
async def function2():
#work with dB
async def checkfile():
# download and check the file
server = web.Application()
server.add_routes([web.get('/', handle)#other routes and options])
if __name__ == '__main__':
Or I came up with the wrong solution to the problem? Please help me to implement the task. Thank you in advance everyone!