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

data ab

Namespace of the experiment functions.

Example:

oxl✓ проверяется в CI
use std.ab { ab }

fn pick(q: str) -> str io {
  match ab.variant("search v2") {
    "b" => "new:{q}"
    _ => "old:{q}"
  }
}

fn main() io {
  print(pick("x"))
}
Вывод
old:x
pub(api) data ab

Потокобезопасность. safe to call from any task; the answer depends only on the request the task is serving.

С версии. 1.0.0-beta

Методы

variant(name: str) -> str io
The name of the variant of experiment name for the calling request ("a" / "b" as declared in test ab).

Определено в: std/ab/ab.oxl:63

См. также