distributed

package
v4.1.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2025 License: GPL-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package distributed handles distributed queries across multiple hosts

Index

Constants

View Source
const (
	// DefaultSemTimeout is the default / fallback amount of time to wait for acquisition
	// of a semaphore when performing concurrent queries
	DefaultSemTimeout = time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryOption

type QueryOption func(*QueryRunner)

QueryOption configures the query runner

func WithMaxConcurrent

func WithMaxConcurrent(sem chan struct{}) QueryOption

WithMaxConcurrent sets a maximum number of concurrent running queries

type QueryRunner

type QueryRunner struct {
	// contains filtered or unexported fields
}

QueryRunner denotes a query runner / executor, wrapping a Querier interface instance with other fields required to perform a distributed query

func NewQueryRunner

func NewQueryRunner(resolvers *hosts.ResolverMap, querier distributed.Querier, opts ...QueryOption) (qr *QueryRunner)

NewQueryRunner instantiates a new distributed query runner

func (*QueryRunner) Run

func (q *QueryRunner) Run(ctx context.Context, args *query.Args) (*results.Result, error)

Run executes / runs the query and creates the final result structure

func (*QueryRunner) RunStreaming

func (q *QueryRunner) RunStreaming(ctx context.Context, args *query.Args, send sse.Sender) (*results.Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL