OxL Справочник OxL
РусскийEnglish

method DynHandle.changes

The values this field takes from now on (a new element whenever the value seen by this node changes).

Example:

oxl✓ проверяется в CI
dynamic Limits {
  rps: u32 = 100
  title: str = "shop"
}

fn firstChange() -> u32 io, time {
  for await v in Limits.get().rps.changes() {
    return v
  }
  0
}

fn main() io, time {
  let l = Limits.get()
  scope {
    let h = spawn firstChange()
    sleep(150ms)
    l.rps.set(500)!
    print("new value {h.join()!}")
  }
}
Вывод
new value 500
pub(api) fn changes() -> stream<T> where T: Serializable

С версии. 1.0.0-beta

Возвращает

stream<T> where T: Serializable

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/dynconf.oxl:494

См. также