workerpool

package
v1.10.4-beta005 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteFn

type ExecuteFn[R Runnable, T Requestable, E Returnable] func(ctx context.Context, object R, options T) (result E, err error)

ExecuteFn is a function type for executing runnable and requestable parameters with returnable results

type Request

type Request[R Runnable, T Requestable, E Returnable] struct {
	Object  R
	Options T
	ExecFn  ExecuteFn[R, T, E]
}

Request contains request parameters and invocation method

type Requestable

type Requestable interface {
	testkube.ExecutionRequest | testkube.TestSuiteExecutionRequest
}

Requestable is an interface of requestable objects

type Response

type Response[E Returnable] struct {
	Result E
	Err    error
}

Response contains result details

type Returnable

type Returnable interface {
	testkube.Execution | testkube.TestSuiteExecution
}

Returnable is an interface of returnable objects

type Runnable

type Runnable interface {
	testkube.Test | testkube.TestSuite
}

Runnable is an interface of runnable objects

type Service

type Service[R Runnable, T Requestable, E Returnable] struct {
	// contains filtered or unexported fields
}

Service is a worker pool service

func New

func New[R Runnable, T Requestable, E Returnable](concurrencyLevel int) Service[R, T, E]

New is a constructor for worker pool service

func (Service[R, T, E]) GetResponses

func (s Service[R, T, E]) GetResponses() <-chan Response[E]

GetResponse return reponses of method execution

func (Service[R, T, E]) Run

func (s Service[R, T, E]) Run(ctx context.Context)

Run is a method to run worker pool

func (Service[R, T, E]) SendRequests

func (s Service[R, T, E]) SendRequests(requests []Request[R, T, E])

SendRequests sends requests to workers

Jump to

Keyboard shortcuts

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