title: Running uvicorn as WindowsService, signal only works in main thread
body: <p>When launching a uvicorn app in a windows service, the service failed to start with error indicating that signal can only be handled in the main thread.</p>
  
  <p>Here is the error message catched in the event log: </p>
  
  <pre><code>Traceback (most recent call last):
    File "site-packages\win32\lib\win32serviceutil.py", line 839, in SvcRun
    File "WindowsService.py", line 49, in SvcDoRun
    File "site-packages\uvicorn\main.py", line 279, in run
    File "site-packages\uvicorn\main.py", line 307, in run
    File "asyncio\base_events.py", line 584, in run_until_complete
    File "site-packages\uvicorn\main.py", line 319, in serve
    File "site-packages\uvicorn\main.py", line 459, in install_signal_handlers
    File "signal.py", line 47, in signal
  ValueError: signal only works in main thread
  </code></pre>
  
  <p>The project works fin un debugging mode.</p>
  
  <pre class="lang-sh prettyprint-override"><code>.\dist\WindowsService.exe debug
  </code></pre>
  
  <p>No parameters allow me to specify to not handle signals.</p>
  
  <p>Here is how I launch prgramatically to uvicorn app: </p>
  
  <pre class="lang-py prettyprint-override"><code>        uvicorn.run(app.main, 
                      host=config['server']['host'], 
                      port=config['server']['port'], 
                      log_level=config['server']['loglevel'], 
                      reload=False)
  </code></pre>
  
  <p>The application is compiled ina frozen executable using <strong>win32serviceutil.ServiceFramework</strong></p>
  
  <pre class="lang-sh prettyprint-override"><code>pyinstaller -F --hidden-import=win32timezone --additional-hooks-dir pyinstaller-hooks WindowsService.py
  </code></pre>
  
  <p>I expected to launch the windows service and have uvicorn application running.</p>