Skip to content

Commit 8376664

Browse files
committed
Remove processor and monitor
1 parent 58b66ba commit 8376664

3 files changed

Lines changed: 1 addition & 121 deletions

File tree

src/murfey/util/__init__.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
import logging
44
from pathlib import Path
5-
from queue import Queue
6-
from threading import Thread
7-
from typing import Any, Callable, Optional
8-
from uuid import uuid4
5+
from typing import Any, Callable
96

107
from werkzeug.utils import secure_filename
118

@@ -61,41 +58,6 @@ def posix_path(path: Path) -> str:
6158
return str(path)
6259

6360

64-
class Processor:
65-
def __init__(self, name: Optional[str] = None):
66-
self._in: Queue = Queue()
67-
self._out: Queue = Queue()
68-
self._previous: Optional[Processor] = None
69-
self.thread: Optional[Thread] = None
70-
self.name = name or str(uuid4())[:8]
71-
72-
def __rshift__(self, other: Processor):
73-
self.point_to(other)
74-
75-
def point_to(self, other: Processor):
76-
if isinstance(other, Processor):
77-
other._in = self._out
78-
other._previous = self
79-
80-
def process(self, in_thread: bool = False, thread_name: str = "", **kwargs):
81-
if in_thread:
82-
self.thread = Thread(
83-
target=self._process,
84-
kwargs=kwargs,
85-
name=thread_name or self.name,
86-
)
87-
self.thread.start()
88-
else:
89-
self._process(**kwargs)
90-
91-
def _process(self, **kwargs):
92-
pass
93-
94-
def wait(self):
95-
if self.thread:
96-
self.thread.join()
97-
98-
9961
def safe_run(
10062
func: Callable,
10163
args: list | tuple = [],

src/murfey/util/file_monitor.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

tests/util/test_monitor.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)