task.rs 691 B

1234567891011121314151617181920212223242526272829
  1. use crate::services::sort::SortController;
  2. use flowy_task::{TaskContent, TaskHandler};
  3. use lib_infra::future::BoxResultFuture;
  4. use std::sync::Arc;
  5. use tokio::sync::RwLock;
  6. pub struct SortTaskHandler {
  7. handler_id: String,
  8. sort_controller: Arc<RwLock<SortController>>,
  9. }
  10. impl SortTaskHandler {
  11. pub fn new(handler_id: String, sort_controller: Arc<RwLock<SortController>>) -> Self {
  12. Self {
  13. handler_id,
  14. sort_controller,
  15. }
  16. }
  17. }
  18. impl TaskHandler for SortTaskHandler {
  19. fn handler_id(&self) -> &str {
  20. &self.handler_id
  21. }
  22. fn run(&self, content: TaskContent) -> BoxResultFuture<(), anyhow::Error> {
  23. todo!();
  24. }
  25. }