AppFlowy-IO / AppFlowy-Cloud

AppFlowy is an open-source alternative to Notion. You are in charge of your data and customizations. Built with Flutter and Rust.
GNU Affero General Public License v3.0
1.08k stars 226 forks source link

chore: enable multiple threads #753

Closed appflowy closed 2 months ago

appflowy commented 2 months ago

Create a custom Tokio runtime for running group collaboration. Different groups may spawn on different threads, enabling concurrency.

In Actix-Web, if a single-threaded Tokio runtime is used (e.g., via the current_thread runtime), all tokio::spawn calls will run on that single thread, meaning tasks are not distributed across multiple threads by default. However, using a multi-threaded Tokio runtime (the default configuration for Tokio) would allow tokio::spawn calls to run on multiple threads.