Skip to content

Commit 4f2e2da

Browse files
committed
wip
1 parent 5d425e2 commit 4f2e2da

File tree

10 files changed

+1262
-2
lines changed

10 files changed

+1262
-2
lines changed

Cargo.lock

Lines changed: 94 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,23 @@ rust-version.workspace = true
2626

2727
[dependencies]
2828
allocator-api2 = { version = "0.2.21", default-features = false }
29+
async-task = { version = "4.7.1", optional = true }
30+
bytes = { version = "1.8.0", optional = true }
31+
http-body = { version = "1.0.1", optional = true }
2932
libc = "0.2"
3033
lock_api = "0.4.13"
3134
nginx-sys = { path = "nginx-sys", default-features=false, version = "0.5.0"}
35+
pin-project-lite = { version = "0.2.15", optional = true }
3236

3337
[features]
34-
default = ["vendored","std"]
38+
default = ["async", "std", "vendored"]
39+
async = [
40+
"std",
41+
"dep:async-task",
42+
"dep:bytes",
43+
"dep:http-body",
44+
"dep:pin-project-lite",
45+
]
3546
# Enables the components using memory allocation.
3647
# If no `std` flag, `alloc` crate is internally used instead. This flag is mainly for `no_std` build.
3748
alloc = ["allocator-api2/alloc"]

examples/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build = "../build.rs"
1414

1515
[dependencies]
1616
nginx-sys = { path = "../nginx-sys/", default-features = false }
17-
ngx = { path = "../", default-features = false, features = ["std"] }
17+
ngx = { path = "../", default-features = false, features = ["async", "std"] }
1818

1919
[dev-dependencies]
2020
aws-sign-v4 = "0.3.0"
@@ -24,6 +24,7 @@ http = "1.1.0"
2424
idna_adapter = "=1.1.0"
2525
libc = "0.2.140"
2626
tokio = { version = "1.33.0", features = ["full"] }
27+
hyper = { version = "1.5.0", features = ["http1", "client"] }
2728

2829
[[example]]
2930
name = "curl"
@@ -56,6 +57,11 @@ name = "shared_dict"
5657
path = "shared_dict.rs"
5758
crate-type = ["cdylib"]
5859

60+
[[example]]
61+
name = "async_ngx"
62+
path = "async_ngx.rs"
63+
crate-type = ["cdylib"]
64+
5965
[features]
6066
default = ["export-modules", "ngx/vendored"]
6167
# Generate `ngx_modules` table with module exports

0 commit comments

Comments
 (0)