tryn

Crates.iotryn
lib.rstryn
version0.1.8
sourcesrc
created_at2024-07-25 00:45:27.128182
updated_at2024-08-17 13:29:27.848864
descriptiontryn
homepagehttps://github.com/i18n-site/rust/tree/main/tryn
repositoryhttps://github.com/i18n-site/rust.git
max_upload_size
id1314569
size4,793
i18n.site (i18nsite)

documentation

README

tryn

use std::sync::atomic::{AtomicU8, Ordering};

use aok::{Result, OK};
use static_init::constructor;

#[constructor(0)]
extern "C" fn init() {
  loginit::init()
}

#[tokio::test]
async fn test() -> Result<()> {
  let n = AtomicU8::new(0);
  tryn::retry(|| async {
    let t = n.fetch_add(1, Ordering::SeqCst);
    if t == 0 {
      aok::throw!("test error");
    }
    Ok(())
  })
  .await?;

  OK
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Commit count: 21

cargo fmt