Skip to content

Commit

Permalink
separate tokio
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyMatt committed May 27, 2024
1 parent 9265d71 commit 92052c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tracing = { version = "0.1.40", default-features = false, features = ["std", "at
url-parse = "1.0.8"

[features]
default = ["redis", "tokio"]
default = ["redis"]
native-tls = ["redis/tls-native-tls"]
rustls = ["redis/tls-rustls"]
tokio = ["dep:tokio", "redis/tokio-comp"]
Expand Down
3 changes: 2 additions & 1 deletion src/client/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ mod tests {
assert!(impossible_client.is_err());
}

#[cfg(feature = "redis")]
#[cfg(all(feature = "tokio", feature = "redis"))]
#[tokio::test]
async fn test_async_builder() {
let conneciton_info = "redis://127.0.0.1:6379".try_into();
Expand All @@ -220,6 +220,7 @@ mod tests {
.is_ok());
}

#[cfg(feature = "tokio")]
#[tokio::test]
#[ignore]
async fn test_async_timeout() {
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ pub(crate) mod test_utils {
}
}

#[cfg(feature = "tokio")]
pub(crate) struct TestAsyncGraphHandle {
pub(crate) inner: AsyncGraph,
}

#[cfg(feature = "tokio")]
impl Drop for TestAsyncGraphHandle {
fn drop(&mut self) {
tokio::runtime::Handle::current().block_on(async {
Expand Down
9 changes: 6 additions & 3 deletions src/response/constraint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
* Licensed under the Server Side Public License v1 (SSPLv1).
*/

use crate::connection::asynchronous::BorrowedAsyncConnection;
use crate::{
connection::blocking::BorrowedSyncConnection,
value::utils::{parse_type, type_val_from_value},
AsyncGraphSchema, EntityType, FalkorAsyncParseable, FalkorDBError, FalkorParsable, FalkorValue,
SyncGraphSchema,
EntityType, FalkorDBError, FalkorParsable, FalkorValue, SyncGraphSchema,
};
use anyhow::Result;
use std::fmt::{Display, Formatter};

#[cfg(feature = "tokio")]
use crate::{
connection::asynchronous::BorrowedAsyncConnection, AsyncGraphSchema, FalkorAsyncParseable,
};

/// The type of restriction to apply for the property
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ConstraintType {
Expand Down

0 comments on commit 92052c8

Please sign in to comment.