community-of-python / microbootstrap

Bootstrap your microservices in a second!
27 stars 2 forks source link

Rework granian + add uvicorn #3

Open insani7y opened 3 months ago

insani7y commented 3 months ago

Currently granian bootstrapper is a function. Think about new possible design, rework granian and add uvicorn

Mernus commented 3 months ago

Also it will be great ro make server tuning as many optionally as we can

I think I can work on this issue on next week&

insani7y commented 3 months ago

Would be great :)

gi0baro commented 3 months ago

@insani7y my 2 cents on this: I would avoid to pass uvloop as loop option to Granian and leave it in auto mode, otherwise you're preventing this to work on any OS/arch unsupported by uvloop (eg: windows).

insani7y commented 3 months ago

@gi0baro yeah, that's true, i think we might make an option, that defaults to asyncio and one can change it to uvloop

gi0baro commented 3 months ago

@gi0baro yeah, that's true, i think we might make an option, that defaults to asyncio and one can change it to uvloop

No need: if you don't specify that option Granian will use uvloop on supported platforms and asyncio on all the others by default. You just need to drop that line.

insani7y commented 3 months ago

Ah, I see now, yeah, we should drop this line then. As i see, uvicorn does the same thing, so this option becomes even mor useless

vrslev commented 3 weeks ago

No need: if you don't specify that option Granian will use uvloop on supported platforms and asyncio on all the others by default. You just need to drop that line.

Didn't know that. Thanks for clarification.