Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectStore ¶
type ObjectStore interface { Put(metav1.Object) OverrideResourceVersionIfNewer(metav1.Object) bool PutIfAbsent(metav1.Object) bool Get(Key) (metav1.Object, bool) Delete(Key) List() []metav1.Object }
ObjectStore is a thread safe store for kubernetes resources
type Request ¶
type Request struct { Key Key Type RequestType RetryCount int }
Request is a write request for an object
func CreateRequest ¶
CreateRequest creates a create request for an object
func DeleteRequest ¶
DeleteRequest creates a delete request for an object
func UpdateRequest ¶
UpdateRequest creates an update request for an object
func (Request) WithIncrementedRetryCount ¶
WithIncrementedRetryCount returns the same request with an incremented RetryCount
type RequestType ¶
type RequestType int
RequestType denotes the type of write request
const ( // CreateRequestType denotes create requests CreateRequestType RequestType = 0 // UpdateRequestType denotes update requests UpdateRequestType RequestType = 1 // DeleteRequestType denotes delete requests DeleteRequestType RequestType = 2 )
type ShardedUniqueQueue ¶
type ShardedUniqueQueue interface { TryAddIfAbsent(Request) bool AddIfAbsent(Request) GetConsumers() []<-chan func() Request QueueLengths() []int }
ShardedUniqueQueue is a queue of write requests for objects. It compacts consecutive create and update requests, provides a slice of channels for consumers. No two requests for the same object will end up in different consumers.
func NewShardedUniqueQueue ¶
func NewShardedUniqueQueue(buckets int) ShardedUniqueQueue
NewShardedUniqueQueue creates a sharded queue of write requests