Better HN
topnewbestaskshowjobs
Log inSign up

gcharbonnier

3 karma · joined Dec 4, 2024 (1y ago) · 3 submissions

Submissions

comment 2mo ago · link · parent

From the article: > Let me clarify something: we created Tinybird ClickHouse because we wanted to build an analytics application without all the pain I'm describing. We do not offer ClickHouse® hosting; we solve the analytics problem

EDIT: I'm wrong, their home page clearly states: "Ship fast over a Managed ClickHouse®", though I don't really understand the difference between a managed clickhouse and clickhouse hosting...

comment 1y ago · link · parent

Nothing and that’s the problem because even though you can do it, your event loop will block until foo has finished executing, meaning that in this thread no other coroutine will be executed in the meantime (an event loop runs in its own thread. Most of the time there is only the main thread thus a single event loop). This defeats the purpose of concurrent programming.

comment 1y ago · link · parent

async with is just syntactic sugar. You could very well call __aenter__ and __aexit__ manually. You could also use an AsyncExitStack, call __aenter__ manually, then enter_async_context, and call aclose when you’re done. Since aclose method exists I guess this is not an anti-pattern.

https://docs.python.org/3/library/contextlib.html#contextlib...