Current CancellationToken::new requires a version argument, which is maintained/passed by the frontend.
To make frontend and http api works together, I wonder if we could simplify the version mechanism as the following way:
impl CancellationToken {
pub fn new_search() -> Self {
let version = ACTIVE_SEARCH_VERSION.fetch_add(1, Ordering::SeqCst) + 1;
Self {
version,
active_version: &ACTIVE_SEARCH_VERSION,
}
}
}
It aligns with the existing new_scan method, which is easier to use.
Current
CancellationToken::newrequires a version argument, which is maintained/passed by the frontend.To make frontend and http api works together, I wonder if we could simplify the version mechanism as the following way:
It aligns with the existing
new_scanmethod, which is easier to use.