Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesigned support for futures. #156

Merged
merged 22 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,6 @@ jobs:
target: x86_64-unknown-linux-gnu
features: futures
optimization: false
- task: features
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
features: async-std
optimization: false
- task: features
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
features: tokio
optimization: false
- task: features
os: ubuntu-latest
rust: stable
Expand Down
30 changes: 1 addition & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,6 @@ version = "0.1.7"
path = "macro"
optional = true

[dependencies.async-std-rs]
package = "async-std"
version = "1"
optional = true
default-features = false
features = ["default", "unstable"]

[dependencies.tokio-rs]
package = "tokio"
version = "1"
optional = true
default-features = false
features = ["rt"]

[dependencies.smol-rs]
package = "smol"
version = "1"
optional = true

[dependencies.indexmap-rs]
package = "indexmap"
version = "1"
Expand All @@ -64,7 +45,7 @@ default = ["exports", "classes", "properties"]
full = ["chrono", "exports", "loader", "allocator", "dyn-load", "either", "indexmap", "classes", "properties", "array-buffer", "macro", "phf"]

# Almost all features excluding "parallel"
full-async = ["full", "async-std", "tokio", "smol"]
full-async = ["full", "futures"]

# Chrono support.
chrono = ["rquickjs-core/chrono"]
Expand Down Expand Up @@ -116,15 +97,6 @@ macro = ["rquickjs-macro"]
# Enable interop between Rust futures and JS Promises
futures = ["rquickjs-core/futures"]

# Enable Tokio async runtime support
tokio = ["rquickjs-core/tokio", "tokio-rs"]

# Enable Async-std runtime support
async-std = ["rquickjs-core/async-std", "async-std-rs"]

# Enable Smol async runtime support
smol = ["rquickjs-core/smol", "smol-rs"]

# Max number of function args
max-args-7 = ["rquickjs-core/max-args-7"]
max-args-8 = ["rquickjs-core/max-args-7"]
Expand Down
59 changes: 6 additions & 53 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,8 @@ optional = true
version = "1"
optional = true

[dependencies.async-task]
version = "4"
optional = true

[dependencies.flume]
version = "0.10"
optional = true

[dependencies.pin-project-lite]
version = "0.2"
optional = true

[dependencies.futures-lite]
version = "1"
[dependencies.async-lock]
version = "2"
optional = true

[dependencies.chrono]
Expand All @@ -46,25 +34,6 @@ optional = true
version = "0.1.7"
path = "../sys"

[dependencies.tokio-rs]
package = "tokio"
version = "1"
optional = true
default-features = false
features = ["rt"]

[dependencies.async-std-rs]
package = "async-std"
version = "1"
optional = true
default-features = false
features = ["default", "unstable"]

[dependencies.smol-rs]
package = "smol"
version = "1"
optional = true

[dependencies.dlopen]
version = "0.1"
optional = true
Expand All @@ -80,7 +49,7 @@ default = []
full = ["chrono", "exports", "loader", "allocator", "dyn-load", "either", "indexmap", "classes", "properties", "array-buffer"]

# Almost all features excluding "parallel"
full-async = ["full", "async-std", "tokio", "smol"]
full-async = ["full", "futures"]

# Use bindgen to generate bindings at compile-type
# otherwise bundled bindings will be used
Expand Down Expand Up @@ -115,16 +84,7 @@ properties = []
array-buffer = []

# Enable interop between Rust futures and JS Promises
futures = ["pin-project-lite", "futures-lite", "async-task", "flume"]

# Enable Tokio async runtime support
tokio = ["futures", "tokio-rs"]

# Enable Async-std runtime support
async-std = ["futures", "async-std-rs"]

# Enable Smol async runtime support
smol = ["futures", "smol-rs"]
futures = ["async-lock"]

# Max number of function args
max-args-7 = []
Expand Down Expand Up @@ -163,17 +123,10 @@ doc-cfg = []
package = "futures"
version = "0.3"

[dev-dependencies.tokio-rs]
package = "tokio"
[dev-dependencies.tokio]
version = "1.0"
default-features = false
features = ["rt", "time", "macros"]

[dev-dependencies.async-std-rs]
package = "async-std"
version = "1.8"
default-features = false
features = ["attributes"]
features = ["rt", "rt-multi-thread", "time", "macros"]

[dev-dependencies.rquickjs]
path = ".."
Expand Down
Loading