aboutsummaryrefslogtreecommitdiff
path: root/docs/pages/1-get-started.md
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-19 00:49:09 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-19 00:49:09 +0800
commit9411f2570cbd494aebefa2b97b6b5a1a5e68bb27 (patch)
tree7c419bd16cc1bc38eb0df04b21fbbfeb0b8c6548 /docs/pages/1-get-started.md
parentf26cd7da74e9b65facb4dc2f16c21683334e0aee (diff)
Remove async runtime requirement from examples
Diffstat (limited to 'docs/pages/1-get-started.md')
-rw-r--r--docs/pages/1-get-started.md32
1 files changed, 15 insertions, 17 deletions
diff --git a/docs/pages/1-get-started.md b/docs/pages/1-get-started.md
index f4edfc0..b05e72b 100644
--- a/docs/pages/1-get-started.md
+++ b/docs/pages/1-get-started.md
@@ -9,24 +9,10 @@ cargo add mingling
Or add the following to your `Cargo.toml`:
```toml
[dependencies]
-mingling = "0.1.5"
+mingling = "0.1.6"
```
-> **Mingling** is an **async program**, so please use `async-std`, `tokio`, or another async runtime.
-
-2. This article assumes you are using the `tokio` async runtime. Add the following to your `Cargo.toml`:
-```toml
-tokio = {
- version = "1",
- features = [
- "macros",
- "rt",
- "rt-multi-thread"
- ]
-}
-```
-
-3. Write the basic code in your `main.rs` or other program entry point.
+2. Write the basic code in your `main.rs` or other program entry point.
```rust
use mingling::macros::{dispatcher, gen_program, r_println, renderer};
@@ -55,7 +41,7 @@ fn render_hello(_prev: HelloEntry) {
gen_program!();
```
-4. Install your command-line program and run it.
+3. Install your command-line program and run it.
```bash
cargo install --path ./
your_bin hello
@@ -65,5 +51,17 @@ Result:
Hello, World!
```
+## About Async Runtime
+
+**Mingling** supports **async runtime**, you can enable the `async` feature to activate it.
+
+After enabling it, **Mingling** will have the following changes:
+
+- The `Chain` trait and `chain!` macro will require you to use **async functions**
+- `Program::exec` will become an async function
+- The `gen_program!` macro will generate async functions
+
+**Mingling** does not depend on any specific asynchronous runtime internally, which means you can freely choose a suitable asynchronous runtime for your program (such as `async-std`, `tokio`)
+
## 💡 Next Steps
> **Mingling**'s basic components [Go](./pages/2-basic)