-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 FlamaWorker only when sqlalchemy is available
- Loading branch information
Showing
19 changed files
with
285 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import abc | ||
|
||
__all__ = ["AbstractRepository"] | ||
__all__ = ["AbstractRepository", "BaseRepository"] | ||
|
||
|
||
class AbstractRepository(abc.ABC): | ||
"""Base class for repositories.""" | ||
"""Abstract class for repositories.""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
... | ||
|
||
|
||
class BaseRepository(AbstractRepository): | ||
"""Base class for repositories.""" | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from flama.ddd.workers.base import * # noqa | ||
from flama.ddd.workers.http import * # noqa | ||
from flama.ddd.workers.noop import * # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from flama.ddd.workers.base import BaseWorker | ||
|
||
|
||
class NoopWorker(BaseWorker): | ||
"""Worker that does not apply any specific behavior. | ||
A basic implementation of the worker class that does not apply any specific behavior. | ||
""" | ||
|
||
async def begin(self) -> None: | ||
"""Start a unit of work.""" | ||
... | ||
|
||
async def end(self, *, rollback: bool = False) -> None: | ||
"""End a unit of work. | ||
:param rollback: If the unit of work should be rolled back. | ||
""" | ||
... | ||
|
||
async def commit(self) -> None: | ||
"""Commit the unit of work.""" | ||
... | ||
|
||
async def rollback(self) -> None: | ||
"""Rollback the unit of work.""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.