Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventScore ¶
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.