title: How to run the functions periodically while main is waiting for the server close
body: <p>I have experience in C programming and new to Python. I would like to run fucntion1 and fucntion2 continuously instead of waiting for server to be closed. Right now the below code run the functions once and wait for the server. How to run the functions? Please help</p>
  <pre><code>async def main():
      function1()
      function2()
      server = await websockets.serve(
          on_connect,
          '192.168.1.251',
          9000,
          subprotocols=['ocpp1.6'],
          ping_interval = 10,
          ping_timeout = 120
          )
      logging.info(&quot;Server Started listening to new connections...&quot;)
      await server.wait_closed()
  </code></pre>