package parallelize
import "k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
Index ¶
- func GetParallelism() int
- func SetParallelism(p int)
- func Until(ctx context.Context, pieces int, doWorkPiece workqueue.DoWorkPieceFunc)
- type ErrorChannel
Functions ¶
func GetParallelism ¶
func GetParallelism() int
GetParallelism returns the currently set parallelism.
func SetParallelism ¶
func SetParallelism(p int)
SetParallelism sets the parallelism for all scheduler algorithms. TODO(#95952): Remove global setter in favor of a struct that holds the configuration.
func Until ¶
func Until(ctx context.Context, pieces int, doWorkPiece workqueue.DoWorkPieceFunc)
Until is a wrapper around workqueue.ParallelizeUntil to use in scheduling algorithms.
Types ¶
type ErrorChannel ¶
type ErrorChannel struct {
// contains filtered or unexported fields
}
ErrorChannel supports non-blocking send and receive operation to capture error. A maximum of one error is kept in the channel and the rest of the errors sent are ignored, unless the existing error is received and the channel becomes empty again.
func NewErrorChannel ¶
func NewErrorChannel() *ErrorChannel
NewErrorChannel returns a new ErrorChannel.
func (*ErrorChannel) ReceiveError ¶
func (e *ErrorChannel) ReceiveError() error
ReceiveError receives an error from channel without blocking on the receiver.
func (*ErrorChannel) SendError ¶
func (e *ErrorChannel) SendError(err error)
SendError sends an error without blocking the sender.
func (*ErrorChannel) SendErrorWithCancel ¶
func (e *ErrorChannel) SendErrorWithCancel(err error, cancel context.CancelFunc)
SendErrorWithCancel sends an error without blocking the sender and calls cancel function.
Source Files ¶
error_channel.go parallelism.go
- Version
- v1.21.0-alpha.2
- Published
- Jan 26, 2021
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 9 minutes ago –
Tools for package owners.