poller

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	Start()
	Stop()
	GetSplitData() SplitData
}

Fetcher is an interface contains GetSplitData, Start and Stop functions

type Poller

type Poller struct {
	Error chan error
	// contains filtered or unexported fields
}

Poller implements Fetcher and contains cache pointer, splitio, and required info to interact with aplitio api

func NewPoller

func NewPoller(splitioAPIKey string, pollingRateSeconds int, serializeSegments bool, splitio api.Splitio) *Poller

NewPoller returns a new Poller

func (*Poller) GetSplitData

func (poller *Poller) GetSplitData() SplitData

GetSplitData returns cache results of SplitData

func (*Poller) Start

func (poller *Poller) Start()

Start creates a goroutine and keep tracking until it stops

func (*Poller) Stop

func (poller *Poller) Stop()

Stop sets quit to true in order to stop the loop

type SplitData

type SplitData struct {
	Splits             []dtos.SplitDTO
	Since              int64
	Segments           []dtos.SegmentChangesDTO
	UsingSegmentsCount int
}

SplitData contains Splits and Segments which is supposed to be updated periodically

Jump to

Keyboard shortcuts

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