Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/adr/0002-only-worker-lifecycle-is-wired.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ from them, then close them on a shutdown event a short-lived script often never
documented in `README.md` rather than hidden: a process that both kicks and executes gets no
lifecycle unless the worker events fire, which `InMemoryBroker.startup()` arranges by firing both
pairs. `container.open()` on worker startup is unconditional and a no-op on a fresh container; it
earns its keep on a second worker cycle, reopening deliberately what the previous `WORKER_SHUTDOWN`
closed instead of leaving modern-di to reopen it implicitly with a `ContainerClosedWarning`.
earns its keep on a second worker cycle, reopening what the previous `WORKER_SHUTDOWN` closed. From
modern-di 4.0 a resolve from a closed container raises `ContainerClosedError`, so without this call
every task in the second cycle would fail.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers = [
"Typing :: Typed",
"Topic :: Software Development :: Libraries",
]
dependencies = ["taskiq>=0.11,<0.13", "modern-di>=3,<4"]
dependencies = ["taskiq>=0.11,<0.13", "modern-di>=3,<5"]
version = "0"

[project.urls]
Expand Down
4 changes: 2 additions & 2 deletions tests/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class DependentCreator:
dep1: SimpleCreator


def fetch_task_name(message: taskiq.TaskiqMessage | None = None) -> str:
return message.task_name if message else ""
def fetch_task_name(message: taskiq.TaskiqMessage) -> str:
return message.task_name


class Dependencies(Group):
Expand Down
Loading