Skip to content

Commit 8a0f47c

Browse files
Moved decorators into their own folder
1 parent b4675ed commit 8a0f47c

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/thread/decorators/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""
2+
Export decorators
3+
"""
4+
5+
from .threaded import threaded
6+
from .processor import processor
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
"""
2-
## Decorators
2+
## Threaded
33
44
Documentation: https://thread.ngjx.org
55
"""
66

77
from functools import wraps
8-
from .thread import Thread
8+
from ..thread import Thread
99

10-
from ._types import Overflow_In, Data_Out, Data_In
10+
from .._types import Overflow_In, Data_In
1111
from typing import Callable, Mapping, Sequence, Optional, Union, overload
1212
from typing_extensions import ParamSpec, TypeVar
1313

1414

1515
T = TypeVar('T')
1616
P = ParamSpec('P')
1717
TargetFunction = Callable[P, T]
18+
19+
1820
NoParamReturn = Callable[P, Thread[P, T]]
1921
WithParamReturn = Callable[[TargetFunction[P, T]], NoParamReturn[P, T]]
2022
FullParamReturn = Callable[P, Thread[P, T]]
2123
WrappedWithParamReturn = Callable[[TargetFunction[P, T]], WithParamReturn[P, T]]
2224

2325

26+
27+
2428
@overload
2529
def threaded(__function: TargetFunction[P, T]) -> NoParamReturn[P, T]: ...
2630

@@ -131,5 +135,3 @@ def wrapped(*parsed_args: P.args, **parsed_kwargs: P.kwargs) -> Thread[P, T]:
131135
return job
132136

133137
return wrapped
134-
135-

0 commit comments

Comments
 (0)