Skip to content

Commit

Permalink
Merge pull request #156 from DelSkayn/async
Browse files Browse the repository at this point in the history
Redesigned support for futures.
  • Loading branch information
DelSkayn committed Jun 5, 2023
2 parents 7f21cf7 + 5b6a03d commit 4b87dff
Show file tree
Hide file tree
Showing 44 changed files with 2,066 additions and 1,523 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
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
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
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

0 comments on commit 4b87dff

Please sign in to comment.