reqctx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithLogger = logging.WithLogger

Functions

func Logger

func Logger(ctx context.Context) *zap.Logger

func ReqStats

func ReqStats(ctx context.Context) metrics.Stats

func Tracer

func Tracer(ctx context.Context) ttrace.Tracer

func WithReqStats

func WithReqStats(ctx context.Context, stats metrics.Stats) context.Context

func WithRequest

func WithRequest(ctx context.Context, req *RequestDetails) context.Context

func WithSpan

func WithSpan(ctx context.Context, name string) (context.Context, *span)

func WithTracer

func WithTracer(ctx context.Context, tracer ttrace.Tracer) context.Context

Types

type ISpan

type ISpan interface {
	ttrace.Span

	EndWithErr(e *error)
}

func Span

func Span(ctx context.Context) ISpan

type IsOutputModuleFunc added in v0.1.0

type IsOutputModuleFunc func(name string) bool

type RequestDetails added in v0.1.0

type RequestDetails struct {
	Request *pbsubstreams.Request

	// What the user requested, derived from either the Request.StartBlockNum or Request.Cursor
	RequestStartBlockNum  uint64
	LinearHandoffBlockNum uint64
	StopBlockNum          uint64

	IsSubRequest   bool
	IsOutputModule IsOutputModuleFunc
}

func Details

func Details(ctx context.Context) *RequestDetails

func (*RequestDetails) ShouldReturnProgressMessages added in v0.1.0

func (d *RequestDetails) ShouldReturnProgressMessages() bool

func (*RequestDetails) ShouldReturnWrittenPartialsInTrailer added in v0.1.0

func (d *RequestDetails) ShouldReturnWrittenPartialsInTrailer(modName string) bool

func (*RequestDetails) ShouldStreamCachedOutputs added in v0.1.0

func (d *RequestDetails) ShouldStreamCachedOutputs() bool

func (*RequestDetails) SkipSnapshotSave added in v0.1.0

func (d *RequestDetails) SkipSnapshotSave(modName string) bool

Called to determine if we *really* need to save this store snapshot. We don't need when we're doing parallel processing and we are concerned only with writing the leaf stores we've been asked to produce. We know the scheduler will have created jobs to produce those stores we're skipping here.

Jump to

Keyboard shortcuts

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