Skip to content

Commit 38cdb39

Browse files
Migrated types threads -> _types
1 parent fa81450 commit 38cdb39

2 files changed

Lines changed: 33 additions & 17 deletions

File tree

src/thread/_types.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
## Types
3+
4+
Documentation: https://thread.ngjx.org
5+
"""
6+
7+
from typing import Any, Literal
8+
9+
ThreadStatus = Literal[
10+
'Idle',
11+
'Running',
12+
'Invoking hooks',
13+
'Completed',
14+
15+
'Errored',
16+
'Kill Scheduled',
17+
'Killed'
18+
]
19+
Data_In = Any
20+
Data_Out = Any
21+
Overflow_In = Any

src/thread/thread.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
1+
"""
2+
## Core of thread
3+
4+
```py
5+
Thread()
6+
ParallelProcessing()
7+
```
8+
"""
9+
110
import sys
211
import time
312
import signal
413
import threading
14+
from functools import wraps
515

616
from . import exceptions
717
from .utils.config import Settings
818
from .utils.algorithm import chunk_split
919

10-
from functools import wraps
20+
from ._types import ThreadStatus, Data_In, Data_Out, Overflow_In
1121
from typing import (
1222
Any, List,
13-
Callable, Union, Optional, Literal,
23+
Callable, Union, Optional,
1424
Mapping, Sequence, Tuple
1525
)
1626

1727

18-
ThreadStatus = Literal[
19-
'Idle',
20-
'Running',
21-
'Invoking hooks',
22-
'Completed',
23-
24-
'Errored',
25-
'Kill Scheduled',
26-
'Killed'
27-
]
28-
Data_In = Any
29-
Data_Out = Any
30-
Overflow_In = Any
31-
32-
3328
Threads: set['Thread'] = set()
3429
class Thread(threading.Thread):
3530
"""

0 commit comments

Comments
 (0)