mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Launcher: keep alive (#1894)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import weakref
|
||||
from enum import Enum, auto
|
||||
from typing import Optional, Callable, List, Iterable
|
||||
|
||||
@@ -48,10 +49,14 @@ class Component:
|
||||
def __repr__(self):
|
||||
return f"{self.__class__.__name__}({self.display_name})"
|
||||
|
||||
processes = weakref.WeakSet()
|
||||
|
||||
def launch_subprocess(func: Callable, name: str = None):
|
||||
global processes
|
||||
import multiprocessing
|
||||
process = multiprocessing.Process(target=func, name=name, daemon=True)
|
||||
process = multiprocessing.Process(target=func, name=name)
|
||||
process.start()
|
||||
processes.add(process)
|
||||
|
||||
class SuffixIdentifier:
|
||||
suffixes: Iterable[str]
|
||||
|
Reference in New Issue
Block a user