Drop the parallel
feature (#1574)
This commit is contained in:
parent
372cd65969
commit
005b27eae8
15 changed files with 27 additions and 30 deletions
|
@ -44,7 +44,7 @@ serde = { version = "1.0.145", features = ["derive"] }
|
|||
serde_cbor = "0.11.2"
|
||||
serde_json = "1.0.85"
|
||||
serde_pack = { version = "1.1.1", package = "rmp-serde" }
|
||||
surrealdb = { path = "lib", features = ["parallel", "protocol-http", "protocol-ws", "rustls"] }
|
||||
surrealdb = { path = "lib", features = ["protocol-http", "protocol-ws", "rustls"] }
|
||||
thiserror = "1.0.37"
|
||||
tokio = { version = "1.21.2", features = ["macros", "signal"] }
|
||||
warp = { version = "0.3.3", features = ["compression", "tls", "websocket"] }
|
||||
|
|
2
Makefile
2
Makefile
|
@ -10,7 +10,7 @@ setup:
|
|||
|
||||
.PHONY: docs
|
||||
docs:
|
||||
cargo doc --open --no-deps --package surrealdb --features rustls,protocol-ws,protocol-http,kv-mem,kv-indxdb,kv-rocksdb,kv-tikv,http,scripting,parallel
|
||||
cargo doc --open --no-deps --package surrealdb --features rustls,protocol-ws,protocol-http,kv-mem,kv-indxdb,kv-rocksdb,kv-tikv,http,scripting
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
|
|
|
@ -32,13 +32,12 @@ kv-fdb-6_2 = ["foundationdb/fdb-6_2", "kv-fdb"]
|
|||
kv-fdb-6_3 = ["foundationdb/fdb-6_3", "kv-fdb"]
|
||||
kv-fdb-7_0 = ["foundationdb/fdb-7_0", "kv-fdb"]
|
||||
kv-fdb-7_1 = ["foundationdb/fdb-7_1", "kv-fdb"]
|
||||
scripting = ["dep:js", "dep:executor"]
|
||||
scripting = ["dep:js"]
|
||||
http = ["dep:reqwest"]
|
||||
native-tls = ["dep:native-tls", "reqwest?/native-tls", "tokio-tungstenite?/native-tls"]
|
||||
rustls = ["dep:rustls", "reqwest?/rustls-tls", "tokio-tungstenite?/__rustls-tls"]
|
||||
# Private features
|
||||
kv-fdb = ["foundationdb"]
|
||||
parallel = ["dep:executor"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
@ -62,7 +61,7 @@ derive = { version = "0.5.0", package = "surrealdb-derive" }
|
|||
deunicode = "1.3.2"
|
||||
dmp = "0.1.1"
|
||||
echodb = { version = "0.3.0", optional = true }
|
||||
executor = { version = "1.4.1", package = "async-executor", optional = true }
|
||||
executor = { version = "1.4.1", package = "async-executor" }
|
||||
flume = "0.10.14"
|
||||
futures = "0.3.24"
|
||||
futures-concurrency = "7.0.0"
|
||||
|
@ -105,7 +104,7 @@ version = "0.1.7"
|
|||
package = "rquickjs"
|
||||
features = [
|
||||
"array-buffer",
|
||||
"bindgen",
|
||||
"bindgen",
|
||||
"classes",
|
||||
"futures",
|
||||
"loader",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[cfg(feature = "parallel")]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[allow(dead_code)]
|
||||
/// Specifies how many concurrent jobs can be buffered in the worker channel.
|
||||
pub const MAX_CONCURRENT_TASKS: usize = 64;
|
||||
|
|
|
@ -351,9 +351,8 @@ impl Iterator {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "wasm32", not(feature = "parallel")))]
|
||||
#[cfg_attr(feature = "parallel", async_recursion)]
|
||||
#[cfg_attr(not(feature = "parallel"), async_recursion(?Send))]
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[async_recursion(?Send)]
|
||||
async fn iterate(
|
||||
&mut self,
|
||||
ctx: &Context<'_>,
|
||||
|
@ -371,9 +370,8 @@ impl Iterator {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "parallel", not(target_arch = "wasm32")))]
|
||||
#[cfg_attr(feature = "parallel", async_recursion)]
|
||||
#[cfg_attr(not(feature = "parallel"), async_recursion(?Send))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[async_recursion]
|
||||
async fn iterate(
|
||||
&mut self,
|
||||
ctx: &Context<'_>,
|
||||
|
|
|
@ -20,10 +20,10 @@ pub(crate) use self::statement::*;
|
|||
pub(crate) use self::transaction::*;
|
||||
pub(crate) use self::variables::*;
|
||||
|
||||
#[cfg(feature = "parallel")]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod channel;
|
||||
|
||||
#[cfg(feature = "parallel")]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub use self::channel::*;
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
pub(crate) use self::document::*;
|
||||
|
||||
#[cfg(feature = "parallel")]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod compute;
|
||||
|
||||
mod allow;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![cfg(feature = "parallel")]
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
use executor::{Executor, Task};
|
||||
use once_cell::sync::Lazy;
|
||||
|
|
|
@ -226,14 +226,14 @@ pub async fn asynchronous(
|
|||
) -> Result<Value, Error> {
|
||||
// Wrappers return a function as opposed to a value so that the dispatch! method can always
|
||||
// perform a function call.
|
||||
#[cfg(feature = "parallel")]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn cpu_intensive<R: Send + 'static>(
|
||||
function: impl FnOnce() -> R + Send + 'static,
|
||||
) -> impl FnOnce() -> executor::Task<R> {
|
||||
|| crate::exe::spawn(async move { function() })
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "parallel"))]
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn cpu_intensive<R: Send + 'static>(
|
||||
function: impl FnOnce() -> R + Send + 'static,
|
||||
) -> impl FnOnce() -> std::future::Ready<R> {
|
||||
|
|
|
@ -11,8 +11,8 @@ use futures::future::try_join_all;
|
|||
use std::collections::HashSet;
|
||||
|
||||
impl Value {
|
||||
#[cfg_attr(feature = "parallel", async_recursion)]
|
||||
#[cfg_attr(not(feature = "parallel"), async_recursion(?Send))]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), async_recursion)]
|
||||
#[cfg_attr(target_arch = "wasm32", async_recursion(?Send))]
|
||||
pub async fn del(
|
||||
&mut self,
|
||||
ctx: &Context<'_>,
|
||||
|
|
|
@ -12,8 +12,8 @@ use async_recursion::async_recursion;
|
|||
use futures::future::try_join_all;
|
||||
|
||||
impl Value {
|
||||
#[cfg_attr(feature = "parallel", async_recursion)]
|
||||
#[cfg_attr(not(feature = "parallel"), async_recursion(?Send))]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), async_recursion)]
|
||||
#[cfg_attr(target_arch = "wasm32", async_recursion(?Send))]
|
||||
pub async fn fetch(
|
||||
&mut self,
|
||||
ctx: &Context<'_>,
|
||||
|
|
|
@ -15,8 +15,8 @@ use async_recursion::async_recursion;
|
|||
use futures::future::try_join_all;
|
||||
|
||||
impl Value {
|
||||
#[cfg_attr(feature = "parallel", async_recursion)]
|
||||
#[cfg_attr(not(feature = "parallel"), async_recursion(?Send))]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), async_recursion)]
|
||||
#[cfg_attr(target_arch = "wasm32", async_recursion(?Send))]
|
||||
pub async fn get(
|
||||
&self,
|
||||
ctx: &Context<'_>,
|
||||
|
|
|
@ -9,8 +9,8 @@ use async_recursion::async_recursion;
|
|||
use futures::future::try_join_all;
|
||||
|
||||
impl Value {
|
||||
#[cfg_attr(feature = "parallel", async_recursion)]
|
||||
#[cfg_attr(not(feature = "parallel"), async_recursion(?Send))]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), async_recursion)]
|
||||
#[cfg_attr(target_arch = "wasm32", async_recursion(?Send))]
|
||||
pub async fn set(
|
||||
&mut self,
|
||||
ctx: &Context<'_>,
|
||||
|
|
|
@ -1284,8 +1284,8 @@ impl Value {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "parallel", async_recursion)]
|
||||
#[cfg_attr(not(feature = "parallel"), async_recursion(?Send))]
|
||||
#[cfg_attr(not(target_arch = "wasm32"), async_recursion)]
|
||||
#[cfg_attr(target_arch = "wasm32", async_recursion(?Send))]
|
||||
pub(crate) async fn compute(
|
||||
&self,
|
||||
ctx: &Context<'_>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![cfg(feature = "parallel")]
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
mod parse;
|
||||
use parse::Parse;
|
||||
|
|
Loading…
Reference in a new issue