Documentation
¶
Overview ¶
Package chlocal delivers query results from the chlocal broker (ADR-0028) as a runstream — engine 1 of ADR-0144's three, and the one that has the least.
A broker-spawned worker is a one-shot `clickhouse-local` process with no listener. It runs, answers, and dies, taking its system tables with it. So this engine plays exactly one of the three roles: it delivers. There is no process list to observe and nothing to kill, and rather than answering "unsupported" at runtime it simply does not implement queryengine.ObservationI or queryengine.ControlI — a consumer asking for those gets its answer from the type.
The result arrives whole, in one bus reply, so the stream it yields is a single data frame and a terminal. That is not a degenerate stream pending improvement; it is what a buffered engine honestly has to say. Streaming replies need a wire that does not exist yet (ADR-0143), and the broker's reserved `Streaming` request flag is still refused for the same reason.
Index ¶
Constants ¶
const DefaultPoolName = "introspect"
DefaultPoolName is the pool an Engine targets when Config names none.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Bus is the caller's bus client. It must hold a SubjectFilter with
// CapDirectionPub (or Both) covering `ch.local.exec.<PoolName>`.
Bus app.BusI
// PoolName is the chlocal pool to execute on; empty means
// [DefaultPoolName].
PoolName string
}
Config parameterises an Engine. Bus is required.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine delivers results from one chlocal pool.
func (*Engine) Deliver ¶
func (inst *Engine) Deliver(ctx context.Context, req queryengine.Request) (st queryengine.StreamI, res queryengine.Result, err error)
Deliver runs req on the pool and returns its result as a stream.
The run id is accepted and goes nowhere, which is R10 rather than an omission: a one-shot worker has no process list to register it in and no query log to retain it, so on this engine the id names the run only on this side of the bus. That is also why the observation and control roles are absent — there would be nothing to address them to.