Skip to content

Commit

Permalink
add types module
Browse files Browse the repository at this point in the history
  • Loading branch information
ungarj committed Nov 6, 2023
1 parent 9e19596 commit 9572f56
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions mapchete/executor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from typing import Any, Callable, Iterator, List, Optional

from mapchete.executor.future import FutureProtocol, MFuture
from mapchete.executor.profiling import Profiler
from mapchete.executor.types import Result
from mapchete.executor.types import Profiler, Result

logger = logging.getLogger(__name__)

Expand Down
18 changes: 18 additions & 0 deletions mapchete/executor/types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from contextlib import AbstractContextManager
from dataclasses import dataclass, field
from typing import Any, Optional


@dataclass
class Profiler:
name: str
ctx: AbstractContextManager
args: tuple = field(default_factory=tuple)
kwargs: dict = field(default_factory=dict)


@dataclass
class Result:
output: Any
profiling: dict = field(default_factory=dict)
exception: Optional[Exception] = None

0 comments on commit 9572f56

Please sign in to comment.