Skip to content

Conversation

@chesnokpeter
Copy link

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)

.venv/
.venv/

uv.lock
Copy link
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
Copy link
Member

Tishka17 commented Jan 7, 2025

  • Tests
  • Can in be used with websockets?
  • Can it be used with nested routers?

@Tishka17
Copy link
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants