Skip to content

add DishkaRouter for integrations/litestar.py#331

Open
chesnokpeter wants to merge 2 commits into
reagento:developfrom
chesnokpeter:develop
Open

add DishkaRouter for integrations/litestar.py#331
chesnokpeter wants to merge 2 commits into
reagento:developfrom
chesnokpeter:develop

Conversation

@chesnokpeter

Copy link
Copy Markdown

Similar to fastapi, i added DishkaRouter to get each handler to not need to hang @inject on every handler

from dishka.integrations.litestar import (
    FromDishka,
    LitestarProvider,
    inject,
    setup_dishka,
    DishkaRouter,
)
    
@post('/')
async def general(gateway: FromDishka[Gateway]) -> Response:
    ...

r = DishkaRouter('', route_handlers=[general])

def create_app() -> Litestar:
    app = Litestar(route_handlers=[r])
    setup_dishka(container, app)

Comment thread .gitignore
.venv/ No newline at end of file
.venv/

uv.lock No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to PR
anyway, we do not use lock here as we develop library

@Tishka17

Tishka17 commented Jan 7, 2025

Copy link
Copy Markdown
Member
  • Tests
  • Can in be used with websockets?
  • Can it be used with nested routers?

@Tishka17

Copy link
Copy Markdown
Member

Hi. Please, provide answers on questions above. This feature looks interesting, but we need to be sure that no updates are expected. I guess, we can handle them on our side if provided some info

@Tishka17 Tishka17 moved this to Backlog in Dishka kanban Apr 13, 2025
@Tishka17 Tishka17 removed this from Dishka kanban Apr 13, 2025
@Tishka17 Tishka17 added the to clarify Needs information or coordination with other issues label Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

to clarify Needs information or coordination with other issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants