~/bend-docscommunity

src/watcher.bend checks

raw source on the hub · import bend-kube-runtime@0.8.0.0/src/watcher.bend as Watcher

3 imports
import Base
import ./json.bend as J
import ./core.bend as C

Types

type Phase source · line 27 · raw

Data

What to do next: list (from a continue token, "" for the first page) or watch from a version.

type WState source · line 33 · raw

Data

fails counts failures since the last success; first says the next page starts a fresh list.

type Input source · line 36 · raw

Data

type Out source · line 44 · raw

Data

What the store and controller see (kube-runtime's watcher::Event).

type Step source · line 53 · raw

Data

A step's result: the next state, its outputs in order, and whether the driver must back off before the next action.

Definitions

def WState.init source · line 56 · raw

WState

def Backoff.delay.go source · line 59 · raw

@+fails:U32 -> @capped:Bool -> U32

def Backoff.delay source · line 72 · raw

@+fails:U32 -> U32

The delay before the next try after fails failures: 800ms doubling, at most 30s. The driver adds jitter. (A count of 0, which no failure leaves, waits as 1 does.)

def Watcher.page_outs source · line 78 · raw

@xs:List<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> @tail:List<&2, Out> -> List<&2, Out>

def Watcher.init_out source · line 85 · raw

@first:Bool -> @rest:List<&2, Out> -> List<&2, Out>

def Watcher.done_out source · line 92 · raw

@last:Bool -> List<&2, Out>

def Watcher.page_phase source · line 99 · raw

@rv:String -> @+cont:String -> @last:Bool -> Phase

def Watcher.page.go source · line 106 · raw

@first:Bool -> @items:List<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> @rv:String -> @+cont:String -> @+last:Bool -> Step

def Watcher.page source · line 113 · raw

@first:Bool -> @p:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Page -> Step

A page of the list: the first page opens a relist (Init), the last one (no continue token) closes it (InitDone) and starts the watch.

def Watcher.is_gone source · line 118 · raw

@+code:U32 -> Bool

def Watcher.relist source · line 121 · raw

@+fails:U32 -> Step

def Watcher.retry source · line 124 · raw

@p:Phase -> @+fails:U32 -> @first:Bool -> Step

def Watcher.list_err source · line 129 · raw

@cont:String -> @+fails:U32 -> @first:Bool -> @gone:Bool -> Step

A failed list: an expired continue token relists; else the same page is retried after a backoff.

def Watcher.watch_err source · line 136 · raw

@rv:String -> @+fails:U32 -> @gone:Bool -> Step

def Watcher.event source · line 144 · raw

@rv:String -> @+fails:U32 -> @ev:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.WEvent -> Step

One watch event while watching from rv.

def Watcher.step source · line 160 · raw

@st:WState -> @i:Input -> Step

The state machine.

def Watcher.merge.go source · line 176 · raw

@outs:List<&2, Out> -> @w:Bool -> @s:Step -> Step

def Watcher.merge source · line 184 · raw

@acc:Step -> @x:Input -> Step

Feeds a run of inputs (the events of one recv), joining the outputs. A step that asks to back off ends the run's effect on the stream: the driver reconnects.

def Watcher.steps source · line 189 · raw

@xs:List<&2, Input> -> @acc:Step -> Step