mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: enable dispatch event using single thread (#3828)
* refactor: lib dispatch * chore: type def * chore: type def * fix: local set spawn * chore: replace tokio spawn * chore: update log * chore: boxed event * chore: tauri lock
This commit is contained in:
@ -37,7 +37,7 @@ pub struct DatabaseEditorTest {
|
||||
|
||||
impl DatabaseEditorTest {
|
||||
pub async fn new_grid() -> Self {
|
||||
let sdk = EventIntegrationTest::new();
|
||||
let sdk = EventIntegrationTest::new().await;
|
||||
let _ = sdk.init_anon_user().await;
|
||||
|
||||
let params = make_test_grid();
|
||||
@ -46,7 +46,7 @@ impl DatabaseEditorTest {
|
||||
}
|
||||
|
||||
pub async fn new_no_date_grid() -> Self {
|
||||
let sdk = EventIntegrationTest::new();
|
||||
let sdk = EventIntegrationTest::new().await;
|
||||
let _ = sdk.init_anon_user().await;
|
||||
|
||||
let params = make_no_date_test_grid();
|
||||
@ -55,7 +55,7 @@ impl DatabaseEditorTest {
|
||||
}
|
||||
|
||||
pub async fn new_board() -> Self {
|
||||
let sdk = EventIntegrationTest::new();
|
||||
let sdk = EventIntegrationTest::new().await;
|
||||
let _ = sdk.init_anon_user().await;
|
||||
|
||||
let params = make_test_board();
|
||||
@ -64,7 +64,7 @@ impl DatabaseEditorTest {
|
||||
}
|
||||
|
||||
pub async fn new_calendar() -> Self {
|
||||
let sdk = EventIntegrationTest::new();
|
||||
let sdk = EventIntegrationTest::new().await;
|
||||
let _ = sdk.init_anon_user().await;
|
||||
|
||||
let params = make_test_calendar();
|
||||
|
@ -14,6 +14,7 @@ use flowy_database2::entities::{CheckboxFilterConditionPB, CheckboxFilterPB, Che
|
||||
use flowy_database2::services::database_view::DatabaseViewChanged;
|
||||
use flowy_database2::services::field::SelectOption;
|
||||
use flowy_database2::services::filter::FilterType;
|
||||
use lib_dispatch::prelude::af_spawn;
|
||||
|
||||
use crate::database::database_editor::DatabaseEditorTest;
|
||||
|
||||
@ -278,7 +279,7 @@ impl DatabaseFilterTest {
|
||||
if change.is_none() {return;}
|
||||
let change = change.unwrap();
|
||||
let mut receiver = self.recv.take().unwrap();
|
||||
tokio::spawn(async move {
|
||||
af_spawn(async move {
|
||||
match tokio::time::timeout(Duration::from_secs(2), receiver.recv()).await {
|
||||
Ok(changed) => {
|
||||
match changed.unwrap() { DatabaseViewChanged::FilterNotification(notification) => {
|
||||
|
Reference in New Issue
Block a user