Skip to content

Commit c0206ce

Browse files
committed
Add async feature
1 parent 0dae466 commit c0206ce

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ jobs:
8383
- name: Build
8484
env:
8585
EXT_PHP_RS_TEST: ""
86-
run: cargo build --release --features closure,anyhow --all
86+
run: cargo build --release --features closure,anyhow,async --all
8787
# Test & lint
8888
- name: Test inline examples
89-
run: cargo test --release --all --features closure,anyhow
89+
run: cargo test --release --all --features closure,anyhow,async
9090
- name: Run rustfmt
9191
if: matrix.rust == 'stable' && matrix.os == 'ubuntu-latest' && matrix.php == '8.2'
9292
run: cargo fmt --all -- --check

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ zip = "0.6"
4141
[features]
4242
closure = []
4343
embed = []
44+
async = []
4445

4546
[workspace]
4647
members = ["crates/macros", "crates/cli"]

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub mod prelude {
4848
pub use crate::php_extern;
4949
pub use crate::php_function;
5050
pub use crate::php_impl;
51+
#[cfg(any(docs, feature = "async"))]
5152
pub use crate::php_async_impl;
5253
pub use crate::php_module;
5354
pub use crate::php_print;
@@ -402,7 +403,7 @@ pub use ext_php_rs_derive::php_impl;
402403
/// # Example
403404
///
404405
/// ```no_run
405-
/// # #![cfg(linux))]
406+
/// # #![cfg(linux)]
406407
/// # use ext_php_rs::prelude::*;
407408
/// use php_tokio::EventLoop;
408409
///
@@ -431,7 +432,10 @@ pub use ext_php_rs_derive::php_impl;
431432
/// pub fn get_module(module: ModuleBuilder) -> ModuleBuilder {
432433
/// module.request_shutdown_function(request_shutdown)
433434
/// }
435+
///
436+
/// pub fn main() {}
434437
/// ```
438+
#[cfg(any(docs, feature = "async"))]
435439
pub use php_tokio::php_async_impl;
436440

437441
/// Annotates a function that will be used by PHP to retrieve information about

0 commit comments

Comments
 (0)