question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support running in background thread

See original GitHub issue

Is 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:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
peterbrittaincommented, Apr 5, 2018

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?

0reactions
peterbrittaincommented, Apr 5, 2018

Good! I assume that’s all you need now… Feel free to follow up if you need more.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found