mod.rs 709 B

123456789101112131415161718192021222324252627
  1. use std::{io, thread};
  2. use thread_id;
  3. use tokio::runtime;
  4. pub mod ready;
  5. pub(crate) fn tokio_default_runtime() -> io::Result<tokio::runtime::Runtime> {
  6. runtime::Builder::new_multi_thread()
  7. .thread_name("flowy-sys")
  8. .enable_io()
  9. .enable_time()
  10. .on_thread_start(move || {
  11. log::trace!(
  12. "{:?} thread started: thread_id= {}",
  13. thread::current(),
  14. thread_id::get()
  15. );
  16. })
  17. .on_thread_stop(move || {
  18. log::trace!(
  19. "{:?} thread stopping: thread_id= {}",
  20. thread::current(),
  21. thread_id::get(),
  22. );
  23. })
  24. .build()
  25. }