pcs.rs 635 B

12345678910111213141516171819202122232425262728293031
  1. use crate::cmd::config::EMU_CONFIG;
  2. use crate::ems::service::Service;
  3. use anyhow::Error;
  4. use std::time::Duration;
  5. use tokio::task::JoinHandle;
  6. pub struct Pcs {}
  7. impl Pcs {
  8. /// 初始化PCS
  9. pub fn new() -> Self {
  10. println!("PCS初始化成功");
  11. Pcs {}
  12. }
  13. // pub fn read(&self){
  14. //
  15. // }
  16. }
  17. impl Service for Pcs {
  18. fn run(&self) -> Result<JoinHandle<()>, Error> {
  19. let handle = tokio::spawn(async {
  20. let emu_config = EMU_CONFIG.get();
  21. loop {
  22. tokio::time::sleep(Duration::from_millis(1)).await;
  23. }
  24. });
  25. Ok(handle)
  26. }
  27. }