Python Forum
asyncio: executing tasks + httpserver
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
asyncio: executing tasks + httpserver
#3
(Aug-29-2020, 09:12 PM)nilamo Wrote: Is there a reason you're using more than one event loop at once?

Hello! Yep, has reason. But task is resolved with help Thread:

Maybe this help for anyone:

def _create_httpserver(p):
    host = ''
    port = p
    HTTPServer((host, port), HandleRequests).serve_forever()

...........

t = threading.Thread(target=_create_httpserver, args=[8080)
t.start()
Reply


Messages In This Thread
asyncio: executing tasks + httpserver - by freebsdd - Aug-28-2020, 09:36 PM
RE: asyncio: executing tasks + httpserver - by freebsdd - Aug-29-2020, 09:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  drawing a table with the status of tasks in each thread pyfoo 3 460 Mar-01-2024, 09:29 AM
Last Post: nerdyaks
  How to script repetitive tasks in dynaform using python BenneGrus 0 1,355 Dec-22-2021, 08:36 AM
Last Post: BenneGrus
  How to add asynchronous tasks as they are needed? AlekseyPython 2 4,025 Jan-11-2019, 02:58 AM
Last Post: AlekseyPython
  How I can limit quantity of parallel executable tasks in asyncio? AlekseyPython 1 2,448 Oct-24-2018, 10:22 AM
Last Post: AlekseyPython
  BaseHTTPServer.HTTPServer pick-a-port? degenaro 1 2,524 Jul-05-2018, 08:36 PM
Last Post: gontajones
  run two tasks concurrently tony1812 1 2,634 Jul-24-2017, 05:43 PM
Last Post: Larz60+
  Tasks for Python Lamon112 2 39,721 Jan-13-2017, 03:32 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020