calculator

package
v0.0.0-...-2942e7d Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventScore

func EventScore(e models.Event) int

Determine the score of an event. An event with higher score should be emitted before lower ones. The score based ordering ensures continuous routability, so events with running instances should be emitted first followed by remove events.

Types

type ActualLRPEventCalculator

type ActualLRPEventCalculator struct {
	ActualLRPGroupHub    events.Hub // DEPRECATED
	ActualLRPInstanceHub events.Hub
}

func (ActualLRPEventCalculator) EmitEvents

func (e ActualLRPEventCalculator) EmitEvents(beforeSet, afterSet []*models.ActualLRP)

EmitEvents emits the events such as when the changes identified in the events are applied to the beforeSet the resulting state is equal to afterSet. The beforeSet and afterSet are assumed to have the same process guid and index.

func (ActualLRPEventCalculator) RecordChange

func (e ActualLRPEventCalculator) RecordChange(before, after *models.ActualLRP, lrps []*models.ActualLRP) []*models.ActualLRP

RecordChange returns a new LRP set with the before LRP replaced with after LRP. The index of after and before is the same. New LRPs (i.e. when before is nil) are appended to the end of the lrp slice.

Jump to

Keyboard shortcuts

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