command

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunParallel

func RunParallel(ctx context.Context, cmd Command, binds *scope.Bindings, input record.Stream, output record.Sink, n int) (finalErr error)

Types

type Command

type Command interface {
	// Run begins execution of the command on an input Record with given bindings, returning a record.Stream of results
	// and derivative bindings for that stream. Execution may continue asynchronously after return, until a call to
	// out.Next returns non-nil error (normally io.EOF).
	//
	// outBinds must be either binds itself or a derivative binding.
	//
	// Both Run and its returned record.Stream operate under ctx, and may return early with ctx.Err() on cancellation.
	//
	// Run is safe for concurrent use by multiple goroutines, and concurrent use with draining the record.Stream returned
	// by any previous call to Run.
	Run(ctx context.Context, in record.Record, binds *scope.Bindings) (out record.Stream, outBinds *scope.Bindings, err error)
}

Command takes action on a sequence of Records, possibly returning more Records in response to each.

Examples include an HTTP command, which runs a request per input Record and returns a response Record; or a parsing command, which reformats each input record into one (or more) Records in a new format.

Jump to

Keyboard shortcuts

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