Support running in background thread
See original GitHub issueIs there a way to run this as a background thread? I tried something like this:
def runUI():
from asciimatics.screen import Screen
Screen.wrapper(statusUI)
def statusUI(screen):
screen.clear()
(height, width) = screen.dimensions
while True:
# ...
screen.refresh()
sleep(1)
from threading import Thread
thread = Thread(target=runUI)
thread.start()
but encounter an error when running:
ValueError: signal only works in main thread
(sorry if this is abusing the GH issue channel – It is partially a support question and partially a feature request)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Run Service in background Thread - Stack Overflow
After finishing the Service, i want the progress bar to be completed (100%). Here is what i have found. It looks like service...
Read more >Foreground and Background Threads | Microsoft Learn
Determine or change whether a thread is a background thread or a foreground thread using the Thread.IsBackground property in .NET.
Read more >How to Run a Triggered Background Task in Python
You can trigger events in a background thread using a daemon thread and a message queue. In this tutorial you will discover how...
Read more >Run MATLAB Functions in Thread-Based Environment
If a function is supported in a thread-based environment, you can use parfeval and backgroundPool to run it in the background.
Read more >Background Tasks - Wisej.NET
It's simple, just return from the call. A background task (like any thread) starts by calling your start method. The method will run...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Am I missing something, but can’t you just construct the Screen on your main thread using the open() method and then run it from your background thread?
Good! I assume that’s all you need now… Feel free to follow up if you need more.