parallel_support

package
v2.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorEarly = fmt.Errorf("early")
View Source
var ErrorFailed = fmt.Errorf("failed")
View Source
var ErrorGone = fmt.Errorf("gone")
View Source
var POLLING_INTERVAL = 50 * time.Millisecond

Functions

This section is empty.

Types

type BeforeSuiteState

type BeforeSuiteState struct {
	Data  []byte
	State types.SpecState
}

type Client

type Client interface {
	Connect() bool
	Close() error

	PostSuiteWillBegin(report types.Report) error
	PostDidRun(report types.SpecReport) error
	PostSuiteDidEnd(report types.Report) error
	PostSynchronizedBeforeSuiteCompleted(state types.SpecState, data []byte) error
	BlockUntilSynchronizedBeforeSuiteData() (types.SpecState, []byte, error)
	BlockUntilNonprimaryProcsHaveFinished() error
	BlockUntilAggregatedNonprimaryProcsReport() (types.Report, error)
	FetchNextCounter() (int, error)
	PostAbort() error
	ShouldAbort() bool
	Write(p []byte) (int, error)
}

func NewClient

func NewClient(serverHost string) Client

type ParallelIndexCounter

type ParallelIndexCounter struct {
	Index int
}

type RPCServer

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

RPCServer spins up on an automatically selected port and listens for communication from the forwarding reporter. It then forwards that communication to attached reporters.

func (*RPCServer) Address

func (server *RPCServer) Address() string

The address the server can be reached it. Pass this into the `ForwardingReporter`.

func (*RPCServer) Close

func (server *RPCServer) Close()

Stop the server

func (*RPCServer) GetOutputDestination

func (server *RPCServer) GetOutputDestination() io.Writer

func (*RPCServer) GetSuiteDone

func (server *RPCServer) GetSuiteDone() chan interface{}

func (*RPCServer) RegisterAlive

func (server *RPCServer) RegisterAlive(node int, alive func() bool)

func (*RPCServer) SetOutputDestination

func (server *RPCServer) SetOutputDestination(w io.Writer)

func (*RPCServer) Start

func (server *RPCServer) Start()

Start the server. You don't need to `go s.Start()`, just `s.Start()`

type Server

type Server interface {
	Start()
	Close()
	Address() string
	RegisterAlive(node int, alive func() bool)
	GetSuiteDone() chan interface{}
	GetOutputDestination() io.Writer
	SetOutputDestination(io.Writer)
}

func NewServer

func NewServer(parallelTotal int, reporter reporters.Reporter) (Server, error)

type ServerHandler

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

func (*ServerHandler) Abort

func (handler *ServerHandler) Abort(_ Void, _ *Void) error

func (*ServerHandler) AggregatedNonprimaryProcsReport

func (handler *ServerHandler) AggregatedNonprimaryProcsReport(_ Void, report *types.Report) error

func (*ServerHandler) BeforeSuiteCompleted

func (handler *ServerHandler) BeforeSuiteCompleted(beforeSuiteState BeforeSuiteState, _ *Void) error

func (*ServerHandler) BeforeSuiteState

func (handler *ServerHandler) BeforeSuiteState(_ Void, beforeSuiteState *BeforeSuiteState) error

func (*ServerHandler) Counter

func (handler *ServerHandler) Counter(_ Void, counter *int) error

func (*ServerHandler) DidRun

func (handler *ServerHandler) DidRun(report types.SpecReport, _ *Void) error

func (*ServerHandler) EmitOutput

func (handler *ServerHandler) EmitOutput(output []byte, n *int) error

func (*ServerHandler) HaveNonprimaryProcsFinished

func (handler *ServerHandler) HaveNonprimaryProcsFinished(_ Void, _ *Void) error

func (*ServerHandler) ShouldAbort

func (handler *ServerHandler) ShouldAbort(_ Void, shouldAbort *bool) error

func (*ServerHandler) SpecSuiteDidEnd

func (handler *ServerHandler) SpecSuiteDidEnd(report types.Report, _ *Void) error

func (*ServerHandler) SpecSuiteWillBegin

func (handler *ServerHandler) SpecSuiteWillBegin(report types.Report, _ *Void) error

type Void

type Void struct{}

Jump to

Keyboard shortcuts

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