package Ġcom . m ire go . tri kot . streams . reactive Ċ Ċ import Ġcom . m ire go . tri kot . foundation . timers . Timer Factory Ċ import Ġcom . m ire go . tri kot . streams . c ancellable . C ancellable Manager Provider Ċ import Ġkotlin . time . Duration Ċ Ċ class ĠRepeat able Publisher ( ĊĠĠĠ Ġprivate Ġval Ġdelay : ĠDuration , ĊĠĠĠ Ġprivate Ġval Ġtimer Factory : ĠTimer Factory Ċ ) Ġ: ĠBehavior Subject Impl < Int >( 0 ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcancell able Manager Provider Ġ= ĠC ancellable Manager Provider () ĊĊĠĠĠ Ġoverride Ġfun Ġon First Subscription () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on First Subscription () ĊĠĠĠĠĠĠĠ Ġval Ġcancell able Manager Ġ= Ġcancell able Manager Provider . cancel Previous And Create () ĊĊĠĠĠĠĠĠĠ Ġval Ġtimer Ġ= Ġtimer Factory . repeat able ( delay ) Ġ{ Ġvalue Ġ= Ġ( value Ġ?: Ġ 0 ) Ġ+ Ġ 1 Ġ} ĊĊĠĠĠĠĠĠĠ Ġcancell able Manager . add Ġ{ Ġtimer . cancel () Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon No Subscription () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on No Subscription () ĊĠĠĠĠĠĠĠ Ġcancell able Manager Provider . cancel Previous And Create () ĊĠĠĠ Ġ} Ċ } Ċ