fix tests
This commit is contained in:
parent
cb4abaefd7
commit
75c16b8c51
16
Cargo.lock
generated
16
Cargo.lock
generated
@ -752,9 +752,9 @@ checksum = "cc12a55e9bd3840279c248c96ecf541d5ba98d6654e08869fe167121384a582c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.12.0"
|
version = "3.12.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
|
checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byte-slice-cast"
|
name = "byte-slice-cast"
|
||||||
@ -2977,9 +2977,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9b085a4f2cde5781fc4b1717f2e86c62f5cda49de7ba99a7c2eae02b61c9064c"
|
checksum = "36eb31c1778188ae1e64398743890d0877fef36d11521ac60406b42016e8c2cf"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
@ -4521,9 +4521,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.37.13"
|
version = "0.37.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f79bef90eb6d984c72722595b5b1348ab39275a5e5123faca6863bf07d75a4e0"
|
checksum = "d9b864d3c18a5785a05953adeed93e2dca37ed30f18e69bba9f30079d51f363f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"errno",
|
"errno",
|
||||||
@ -5721,9 +5721,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing-subscriber"
|
name = "tracing-subscriber"
|
||||||
version = "0.3.16"
|
version = "0.3.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70"
|
checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"matchers",
|
"matchers",
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
|
|
||||||
members = [
|
members = [
|
||||||
"veilid-tools",
|
"veilid-tools",
|
||||||
"veilid-core",
|
"veilid-core",
|
||||||
|
@ -23,6 +23,8 @@ logging:
|
|||||||
enabled: false
|
enabled: false
|
||||||
level: 'trace'
|
level: 'trace'
|
||||||
grpc_endpoint: 'localhost:4317'
|
grpc_endpoint: 'localhost:4317'
|
||||||
|
console:
|
||||||
|
enabled: false
|
||||||
testing:
|
testing:
|
||||||
subnode_index: 0
|
subnode_index: 0
|
||||||
core:
|
core:
|
||||||
@ -47,10 +49,10 @@ core:
|
|||||||
client_whitelist_timeout_ms: 300000
|
client_whitelist_timeout_ms: 300000
|
||||||
reverse_connection_receipt_time_ms: 5000
|
reverse_connection_receipt_time_ms: 5000
|
||||||
hole_punch_receipt_time_ms: 5000
|
hole_punch_receipt_time_ms: 5000
|
||||||
node_id: ''
|
|
||||||
node_id_secret: ''
|
|
||||||
bootstrap: ['bootstrap.dev.veilid.net']
|
|
||||||
routing_table:
|
routing_table:
|
||||||
|
node_id: null
|
||||||
|
node_id_secret: null
|
||||||
|
bootstrap: ['bootstrap.dev.veilid.net']
|
||||||
limit_over_attached: 64
|
limit_over_attached: 64
|
||||||
limit_fully_attached: 32
|
limit_fully_attached: 32
|
||||||
limit_attached_strong: 16
|
limit_attached_strong: 16
|
||||||
@ -61,27 +63,31 @@ core:
|
|||||||
queue_size: 1024
|
queue_size: 1024
|
||||||
max_timestamp_behind_ms: 10000
|
max_timestamp_behind_ms: 10000
|
||||||
max_timestamp_ahead_ms: 10000
|
max_timestamp_ahead_ms: 10000
|
||||||
timeout_ms: 10000
|
timeout_ms: 5000
|
||||||
max_route_hop_count: 4
|
max_route_hop_count: 4
|
||||||
default_route_hop_count: 1
|
default_route_hop_count: 1
|
||||||
|
|
||||||
dht:
|
dht:
|
||||||
resolve_node_timeout:
|
resolve_node_timeout_ms: 10000
|
||||||
resolve_node_count: 20
|
resolve_node_count: 20
|
||||||
resolve_node_fanout: 3
|
resolve_node_fanout: 3
|
||||||
max_find_node_count: 20
|
max_find_node_count: 20
|
||||||
get_value_timeout:
|
get_value_timeout_ms: 10000
|
||||||
get_value_count: 20
|
get_value_count: 20
|
||||||
get_value_fanout: 3
|
get_value_fanout: 3
|
||||||
set_value_timeout:
|
set_value_timeout_ms: 10000
|
||||||
set_value_count: 20
|
set_value_count: 20
|
||||||
set_value_fanout: 5
|
set_value_fanout: 5
|
||||||
min_peer_count: 20
|
min_peer_count: 20
|
||||||
min_peer_refresh_time_ms: 2000
|
min_peer_refresh_time_ms: 2000
|
||||||
validate_dial_info_receipt_time_ms: 2000
|
validate_dial_info_receipt_time_ms: 2000
|
||||||
|
local_subkey_cache_size: 128
|
||||||
|
local_max_subkey_cache_memory_mb: 256
|
||||||
|
remote_subkey_cache_size: 1024
|
||||||
|
remote_max_records: 65536
|
||||||
|
remote_max_subkey_cache_memory_mb: %REMOTE_MAX_SUBKEY_CACHE_MEMORY_MB%
|
||||||
|
remote_max_storage_space_mb: 0
|
||||||
upnp: true
|
upnp: true
|
||||||
detect_address_changes: true
|
detect_address_changes: true
|
||||||
enable_local_peer_scope: false
|
|
||||||
restricted_nat_retries: 0
|
restricted_nat_retries: 0
|
||||||
tls:
|
tls:
|
||||||
certificate_path: '%CERTIFICATE_PATH%'
|
certificate_path: '%CERTIFICATE_PATH%'
|
||||||
@ -123,5 +129,4 @@ core:
|
|||||||
max_connections: 16
|
max_connections: 16
|
||||||
listen_address: ':5150'
|
listen_address: ':5150'
|
||||||
path: 'ws'
|
path: 'ws'
|
||||||
# url: ''
|
# url: ''
|
||||||
|
|
@ -225,7 +225,7 @@ rpc:
|
|||||||
queue_size: 1024
|
queue_size: 1024
|
||||||
max_timestamp_behind_ms: 10000
|
max_timestamp_behind_ms: 10000
|
||||||
max_timestamp_ahead_ms: 10000
|
max_timestamp_ahead_ms: 10000
|
||||||
timeout_ms: 10000
|
timeout_ms: 5000
|
||||||
max_route_hop_count: 4
|
max_route_hop_count: 4
|
||||||
default_route_hop_count: 1
|
default_route_hop_count: 1
|
||||||
```
|
```
|
||||||
@ -234,19 +234,25 @@ rpc:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
dht:
|
dht:
|
||||||
resolve_node_timeout:
|
resolve_node_timeout_ms: 10000
|
||||||
resolve_node_count: 20
|
resolve_node_count: 20
|
||||||
resolve_node_fanout: 3
|
resolve_node_fanout: 3
|
||||||
max_find_node_count: 20
|
max_find_node_count: 20
|
||||||
get_value_timeout:
|
get_value_timeout_ms: 10000
|
||||||
get_value_count: 20
|
get_value_count: 20
|
||||||
get_value_fanout: 3
|
get_value_fanout: 3
|
||||||
set_value_timeout:
|
set_value_timeout_ms: 10000
|
||||||
set_value_count: 20
|
set_value_count: 20
|
||||||
set_value_fanout: 5
|
set_value_fanout: 5
|
||||||
min_peer_count: 20
|
min_peer_count: 20
|
||||||
min_peer_refresh_time_ms: 2000
|
min_peer_refresh_time_ms: 2000
|
||||||
validate_dial_info_receipt_time_ms: 2000
|
validate_dial_info_receipt_time_ms: 2000
|
||||||
|
local_subkey_cache_size: 128
|
||||||
|
local_max_subkey_cache_memory_mb: 256
|
||||||
|
remote_subkey_cache_size: 1024
|
||||||
|
remote_max_records: 65536
|
||||||
|
remote_max_subkey_cache_memory_mb: %REMOTE_MAX_SUBKEY_CACHE_MEMORY_MB%
|
||||||
|
remote_max_storage_space_mb: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
#### core:network:tls
|
#### core:network:tls
|
||||||
|
@ -17,6 +17,7 @@ enable-crypto-vld0 = []
|
|||||||
enable-crypto-none = []
|
enable-crypto-none = []
|
||||||
rt-async-std = ["async-std", "async-std-resolver", "async_executors/async_std", "rtnetlink?/smol_socket", "veilid-tools/rt-async-std"]
|
rt-async-std = ["async-std", "async-std-resolver", "async_executors/async_std", "rtnetlink?/smol_socket", "veilid-tools/rt-async-std"]
|
||||||
rt-tokio = ["tokio", "tokio-util", "tokio-stream", "trust-dns-resolver/tokio-runtime", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer", "rtnetlink?/tokio_socket", "veilid-tools/rt-tokio"]
|
rt-tokio = ["tokio", "tokio-util", "tokio-stream", "trust-dns-resolver/tokio-runtime", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer", "rtnetlink?/tokio_socket", "veilid-tools/rt-tokio"]
|
||||||
|
rt-wasm-bindgen = ["veilid-tools/rt-wasm-bindgen", "async_executors/bindgen"]
|
||||||
|
|
||||||
veilid_core_android_tests = ["dep:paranoid-android"]
|
veilid_core_android_tests = ["dep:paranoid-android"]
|
||||||
veilid_core_ios_tests = ["dep:tracing-oslog"]
|
veilid_core_ios_tests = ["dep:tracing-oslog"]
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
use crate::crypto::Crypto;
|
|
||||||
use crate::network_manager::*;
|
|
||||||
use crate::routing_table::*;
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
use crypto::Crypto;
|
||||||
|
use network_manager::*;
|
||||||
|
use routing_table::*;
|
||||||
|
use storage_manager::*;
|
||||||
|
|
||||||
pub struct AttachmentManagerInner {
|
pub struct AttachmentManagerInner {
|
||||||
last_attachment_state: AttachmentState,
|
last_attachment_state: AttachmentState,
|
||||||
@ -26,6 +27,7 @@ pub struct AttachmentManager {
|
|||||||
impl AttachmentManager {
|
impl AttachmentManager {
|
||||||
fn new_unlocked_inner(
|
fn new_unlocked_inner(
|
||||||
config: VeilidConfig,
|
config: VeilidConfig,
|
||||||
|
storage_manager: StorageManager,
|
||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
@ -35,6 +37,7 @@ impl AttachmentManager {
|
|||||||
config: config.clone(),
|
config: config.clone(),
|
||||||
network_manager: NetworkManager::new(
|
network_manager: NetworkManager::new(
|
||||||
config,
|
config,
|
||||||
|
storage_manager,
|
||||||
protected_store,
|
protected_store,
|
||||||
table_store,
|
table_store,
|
||||||
block_store,
|
block_store,
|
||||||
@ -54,6 +57,7 @@ impl AttachmentManager {
|
|||||||
}
|
}
|
||||||
pub fn new(
|
pub fn new(
|
||||||
config: VeilidConfig,
|
config: VeilidConfig,
|
||||||
|
storage_manager: StorageManager,
|
||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
@ -63,6 +67,7 @@ impl AttachmentManager {
|
|||||||
inner: Arc::new(Mutex::new(Self::new_inner())),
|
inner: Arc::new(Mutex::new(Self::new_inner())),
|
||||||
unlocked_inner: Arc::new(Self::new_unlocked_inner(
|
unlocked_inner: Arc::new(Self::new_unlocked_inner(
|
||||||
config,
|
config,
|
||||||
|
storage_manager,
|
||||||
protected_store,
|
protected_store,
|
||||||
table_store,
|
table_store,
|
||||||
block_store,
|
block_store,
|
||||||
|
@ -106,11 +106,27 @@ impl ServicesContext {
|
|||||||
}
|
}
|
||||||
self.block_store = Some(block_store.clone());
|
self.block_store = Some(block_store.clone());
|
||||||
|
|
||||||
|
// Set up storage manager
|
||||||
|
trace!("init storage manager");
|
||||||
|
let storage_manager = StorageManager::new(
|
||||||
|
self.config.clone(),
|
||||||
|
self.crypto.clone().unwrap(),
|
||||||
|
self.protected_store.clone().unwrap(),
|
||||||
|
self.table_store.clone().unwrap(),
|
||||||
|
self.block_store.clone().unwrap(),
|
||||||
|
);
|
||||||
|
if let Err(e) = storage_manager.init().await {
|
||||||
|
self.shutdown().await;
|
||||||
|
return Err(e);
|
||||||
|
}
|
||||||
|
self.storage_manager = Some(storage_manager.clone());
|
||||||
|
|
||||||
// Set up attachment manager
|
// Set up attachment manager
|
||||||
trace!("init attachment manager");
|
trace!("init attachment manager");
|
||||||
let update_callback = self.update_callback.clone();
|
let update_callback = self.update_callback.clone();
|
||||||
let attachment_manager = AttachmentManager::new(
|
let attachment_manager = AttachmentManager::new(
|
||||||
self.config.clone(),
|
self.config.clone(),
|
||||||
|
storage_manager,
|
||||||
protected_store,
|
protected_store,
|
||||||
table_store,
|
table_store,
|
||||||
block_store,
|
block_store,
|
||||||
@ -122,26 +138,6 @@ impl ServicesContext {
|
|||||||
}
|
}
|
||||||
self.attachment_manager = Some(attachment_manager);
|
self.attachment_manager = Some(attachment_manager);
|
||||||
|
|
||||||
// Set up storage manager
|
|
||||||
trace!("init storage manager");
|
|
||||||
let storage_manager = StorageManager::new(
|
|
||||||
self.config.clone(),
|
|
||||||
self.crypto.clone().unwrap(),
|
|
||||||
self.protected_store.clone().unwrap(),
|
|
||||||
self.table_store.clone().unwrap(),
|
|
||||||
self.block_store.clone().unwrap(),
|
|
||||||
self.attachment_manager
|
|
||||||
.clone()
|
|
||||||
.unwrap()
|
|
||||||
.network_manager()
|
|
||||||
.rpc_processor(),
|
|
||||||
);
|
|
||||||
if let Err(e) = storage_manager.init().await {
|
|
||||||
self.shutdown().await;
|
|
||||||
return Err(e);
|
|
||||||
}
|
|
||||||
self.storage_manager = Some(storage_manager.clone());
|
|
||||||
|
|
||||||
info!("Veilid API startup complete");
|
info!("Veilid API startup complete");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -150,14 +146,14 @@ impl ServicesContext {
|
|||||||
pub async fn shutdown(&mut self) {
|
pub async fn shutdown(&mut self) {
|
||||||
info!("Veilid API shutting down");
|
info!("Veilid API shutting down");
|
||||||
|
|
||||||
if let Some(storage_manager) = &mut self.storage_manager {
|
|
||||||
trace!("terminate storage manager");
|
|
||||||
storage_manager.terminate().await;
|
|
||||||
}
|
|
||||||
if let Some(attachment_manager) = &mut self.attachment_manager {
|
if let Some(attachment_manager) = &mut self.attachment_manager {
|
||||||
trace!("terminate attachment manager");
|
trace!("terminate attachment manager");
|
||||||
attachment_manager.terminate().await;
|
attachment_manager.terminate().await;
|
||||||
}
|
}
|
||||||
|
if let Some(storage_manager) = &mut self.storage_manager {
|
||||||
|
trace!("terminate storage manager");
|
||||||
|
storage_manager.terminate().await;
|
||||||
|
}
|
||||||
if let Some(block_store) = &mut self.block_store {
|
if let Some(block_store) = &mut self.block_store {
|
||||||
trace!("terminate block store");
|
trace!("terminate block store");
|
||||||
block_store.terminate().await;
|
block_store.terminate().await;
|
||||||
@ -191,12 +187,12 @@ pub struct VeilidCoreContext {
|
|||||||
pub config: VeilidConfig,
|
pub config: VeilidConfig,
|
||||||
pub update_callback: UpdateCallback,
|
pub update_callback: UpdateCallback,
|
||||||
// Services
|
// Services
|
||||||
|
pub storage_manager: StorageManager,
|
||||||
pub protected_store: ProtectedStore,
|
pub protected_store: ProtectedStore,
|
||||||
pub table_store: TableStore,
|
pub table_store: TableStore,
|
||||||
pub block_store: BlockStore,
|
pub block_store: BlockStore,
|
||||||
pub crypto: Crypto,
|
pub crypto: Crypto,
|
||||||
pub attachment_manager: AttachmentManager,
|
pub attachment_manager: AttachmentManager,
|
||||||
pub storage_manager: StorageManager,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VeilidCoreContext {
|
impl VeilidCoreContext {
|
||||||
@ -242,14 +238,14 @@ impl VeilidCoreContext {
|
|||||||
sc.startup().await.map_err(VeilidAPIError::generic)?;
|
sc.startup().await.map_err(VeilidAPIError::generic)?;
|
||||||
|
|
||||||
Ok(VeilidCoreContext {
|
Ok(VeilidCoreContext {
|
||||||
update_callback: sc.update_callback,
|
|
||||||
config: sc.config,
|
config: sc.config,
|
||||||
|
update_callback: sc.update_callback,
|
||||||
|
storage_manager: sc.storage_manager.unwrap(),
|
||||||
protected_store: sc.protected_store.unwrap(),
|
protected_store: sc.protected_store.unwrap(),
|
||||||
table_store: sc.table_store.unwrap(),
|
table_store: sc.table_store.unwrap(),
|
||||||
block_store: sc.block_store.unwrap(),
|
block_store: sc.block_store.unwrap(),
|
||||||
crypto: sc.crypto.unwrap(),
|
crypto: sc.crypto.unwrap(),
|
||||||
attachment_manager: sc.attachment_manager.unwrap(),
|
attachment_manager: sc.attachment_manager.unwrap(),
|
||||||
storage_manager: sc.storage_manager.unwrap(),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ use native::*;
|
|||||||
use receipt_manager::*;
|
use receipt_manager::*;
|
||||||
use routing_table::*;
|
use routing_table::*;
|
||||||
use rpc_processor::*;
|
use rpc_processor::*;
|
||||||
|
use storage_manager::*;
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
use wasm::*;
|
use wasm::*;
|
||||||
|
|
||||||
@ -146,6 +147,7 @@ struct NetworkManagerInner {
|
|||||||
struct NetworkManagerUnlockedInner {
|
struct NetworkManagerUnlockedInner {
|
||||||
// Handles
|
// Handles
|
||||||
config: VeilidConfig,
|
config: VeilidConfig,
|
||||||
|
storage_manager: StorageManager,
|
||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
@ -176,6 +178,7 @@ impl NetworkManager {
|
|||||||
}
|
}
|
||||||
fn new_unlocked_inner(
|
fn new_unlocked_inner(
|
||||||
config: VeilidConfig,
|
config: VeilidConfig,
|
||||||
|
storage_manager: StorageManager,
|
||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
@ -183,6 +186,7 @@ impl NetworkManager {
|
|||||||
) -> NetworkManagerUnlockedInner {
|
) -> NetworkManagerUnlockedInner {
|
||||||
NetworkManagerUnlockedInner {
|
NetworkManagerUnlockedInner {
|
||||||
config,
|
config,
|
||||||
|
storage_manager,
|
||||||
protected_store,
|
protected_store,
|
||||||
table_store,
|
table_store,
|
||||||
block_store,
|
block_store,
|
||||||
@ -197,6 +201,7 @@ impl NetworkManager {
|
|||||||
|
|
||||||
pub fn new(
|
pub fn new(
|
||||||
config: VeilidConfig,
|
config: VeilidConfig,
|
||||||
|
storage_manager: StorageManager,
|
||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
@ -206,6 +211,7 @@ impl NetworkManager {
|
|||||||
inner: Arc::new(Mutex::new(Self::new_inner())),
|
inner: Arc::new(Mutex::new(Self::new_inner())),
|
||||||
unlocked_inner: Arc::new(Self::new_unlocked_inner(
|
unlocked_inner: Arc::new(Self::new_unlocked_inner(
|
||||||
config,
|
config,
|
||||||
|
storage_manager,
|
||||||
protected_store,
|
protected_store,
|
||||||
table_store,
|
table_store,
|
||||||
block_store,
|
block_store,
|
||||||
@ -226,6 +232,9 @@ impl NetworkManager {
|
|||||||
{
|
{
|
||||||
f(&*self.unlocked_inner.config.get())
|
f(&*self.unlocked_inner.config.get())
|
||||||
}
|
}
|
||||||
|
pub fn storage_manager(&self) -> StorageManager {
|
||||||
|
self.unlocked_inner.storage_manager.clone()
|
||||||
|
}
|
||||||
pub fn protected_store(&self) -> ProtectedStore {
|
pub fn protected_store(&self) -> ProtectedStore {
|
||||||
self.unlocked_inner.protected_store.clone()
|
self.unlocked_inner.protected_store.clone()
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ use network_manager::*;
|
|||||||
use receipt_manager::*;
|
use receipt_manager::*;
|
||||||
use routing_table::*;
|
use routing_table::*;
|
||||||
use stop_token::future::FutureExt;
|
use stop_token::future::FutureExt;
|
||||||
use storage_manager::StorageManager;
|
use storage_manager::*;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -227,7 +227,6 @@ pub struct RPCProcessorInner {
|
|||||||
send_channel: Option<flume::Sender<(Option<Id>, RPCMessageEncoded)>>,
|
send_channel: Option<flume::Sender<(Option<Id>, RPCMessageEncoded)>>,
|
||||||
stop_source: Option<StopSource>,
|
stop_source: Option<StopSource>,
|
||||||
worker_join_handles: Vec<MustJoinHandle<()>>,
|
worker_join_handles: Vec<MustJoinHandle<()>>,
|
||||||
opt_storage_manager: Option<StorageManager>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct RPCProcessorUnlockedInner {
|
pub struct RPCProcessorUnlockedInner {
|
||||||
@ -246,6 +245,7 @@ pub struct RPCProcessor {
|
|||||||
crypto: Crypto,
|
crypto: Crypto,
|
||||||
config: VeilidConfig,
|
config: VeilidConfig,
|
||||||
network_manager: NetworkManager,
|
network_manager: NetworkManager,
|
||||||
|
storage_manager: StorageManager,
|
||||||
routing_table: RoutingTable,
|
routing_table: RoutingTable,
|
||||||
inner: Arc<Mutex<RPCProcessorInner>>,
|
inner: Arc<Mutex<RPCProcessorInner>>,
|
||||||
unlocked_inner: Arc<RPCProcessorUnlockedInner>,
|
unlocked_inner: Arc<RPCProcessorUnlockedInner>,
|
||||||
@ -257,7 +257,6 @@ impl RPCProcessor {
|
|||||||
send_channel: None,
|
send_channel: None,
|
||||||
stop_source: None,
|
stop_source: None,
|
||||||
worker_join_handles: Vec::new(),
|
worker_join_handles: Vec::new(),
|
||||||
opt_storage_manager: None,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn new_unlocked_inner(
|
fn new_unlocked_inner(
|
||||||
@ -298,6 +297,7 @@ impl RPCProcessor {
|
|||||||
config: config.clone(),
|
config: config.clone(),
|
||||||
network_manager: network_manager.clone(),
|
network_manager: network_manager.clone(),
|
||||||
routing_table: network_manager.routing_table(),
|
routing_table: network_manager.routing_table(),
|
||||||
|
storage_manager: network_manager.storage_manager(),
|
||||||
inner: Arc::new(Mutex::new(Self::new_inner())),
|
inner: Arc::new(Mutex::new(Self::new_inner())),
|
||||||
unlocked_inner: Arc::new(Self::new_unlocked_inner(config, update_callback)),
|
unlocked_inner: Arc::new(Self::new_unlocked_inner(config, update_callback)),
|
||||||
}
|
}
|
||||||
@ -311,14 +311,8 @@ impl RPCProcessor {
|
|||||||
self.routing_table.clone()
|
self.routing_table.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_storage_manager(&self, opt_storage_manager: Option<StorageManager>) {
|
pub fn storage_manager(&self) -> StorageManager {
|
||||||
let mut inner = self.inner.lock();
|
self.storage_manager.clone()
|
||||||
inner.opt_storage_manager = opt_storage_manager
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn storage_manager(&self) -> Option<StorageManager> {
|
|
||||||
let inner = self.inner.lock();
|
|
||||||
inner.opt_storage_manager.clone()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -326,28 +320,35 @@ impl RPCProcessor {
|
|||||||
#[instrument(level = "debug", skip_all, err)]
|
#[instrument(level = "debug", skip_all, err)]
|
||||||
pub async fn startup(&self) -> EyreResult<()> {
|
pub async fn startup(&self) -> EyreResult<()> {
|
||||||
debug!("startup rpc processor");
|
debug!("startup rpc processor");
|
||||||
let mut inner = self.inner.lock();
|
{
|
||||||
|
let mut inner = self.inner.lock();
|
||||||
|
|
||||||
let channel = flume::bounded(self.unlocked_inner.queue_size as usize);
|
let channel = flume::bounded(self.unlocked_inner.queue_size as usize);
|
||||||
inner.send_channel = Some(channel.0.clone());
|
inner.send_channel = Some(channel.0.clone());
|
||||||
inner.stop_source = Some(StopSource::new());
|
inner.stop_source = Some(StopSource::new());
|
||||||
|
|
||||||
// spin up N workers
|
// spin up N workers
|
||||||
trace!(
|
trace!(
|
||||||
"Spinning up {} RPC workers",
|
"Spinning up {} RPC workers",
|
||||||
self.unlocked_inner.concurrency
|
self.unlocked_inner.concurrency
|
||||||
);
|
);
|
||||||
for _ in 0..self.unlocked_inner.concurrency {
|
for _ in 0..self.unlocked_inner.concurrency {
|
||||||
let this = self.clone();
|
let this = self.clone();
|
||||||
let receiver = channel.1.clone();
|
let receiver = channel.1.clone();
|
||||||
let jh = spawn(Self::rpc_worker(
|
let jh = spawn(Self::rpc_worker(
|
||||||
this,
|
this,
|
||||||
inner.stop_source.as_ref().unwrap().token(),
|
inner.stop_source.as_ref().unwrap().token(),
|
||||||
receiver,
|
receiver,
|
||||||
));
|
));
|
||||||
inner.worker_join_handles.push(jh);
|
inner.worker_join_handles.push(jh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inform storage manager we are up
|
||||||
|
self.storage_manager
|
||||||
|
.set_rpc_processor(Some(self.clone()))
|
||||||
|
.await;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,6 +356,9 @@ impl RPCProcessor {
|
|||||||
pub async fn shutdown(&self) {
|
pub async fn shutdown(&self) {
|
||||||
debug!("starting rpc processor shutdown");
|
debug!("starting rpc processor shutdown");
|
||||||
|
|
||||||
|
// Stop storage manager from using us
|
||||||
|
self.storage_manager.set_rpc_processor(None).await;
|
||||||
|
|
||||||
// Stop the rpc workers
|
// Stop the rpc workers
|
||||||
let mut unord = FuturesUnordered::new();
|
let mut unord = FuturesUnordered::new();
|
||||||
{
|
{
|
||||||
|
@ -29,6 +29,8 @@ struct StorageManagerInner {
|
|||||||
local_record_store: Option<RecordStore>,
|
local_record_store: Option<RecordStore>,
|
||||||
/// Records that have been pushed to this node for distribution by other nodes
|
/// Records that have been pushed to this node for distribution by other nodes
|
||||||
remote_record_store: Option<RecordStore>,
|
remote_record_store: Option<RecordStore>,
|
||||||
|
/// RPC processor if it is available
|
||||||
|
rpc_processor: Option<RPCProcessor>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct StorageManagerUnlockedInner {
|
struct StorageManagerUnlockedInner {
|
||||||
@ -37,7 +39,6 @@ struct StorageManagerUnlockedInner {
|
|||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
rpc_processor: RPCProcessor,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@ -53,7 +54,6 @@ impl StorageManager {
|
|||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
rpc_processor: RPCProcessor,
|
|
||||||
) -> StorageManagerUnlockedInner {
|
) -> StorageManagerUnlockedInner {
|
||||||
StorageManagerUnlockedInner {
|
StorageManagerUnlockedInner {
|
||||||
config,
|
config,
|
||||||
@ -61,7 +61,6 @@ impl StorageManager {
|
|||||||
protected_store,
|
protected_store,
|
||||||
table_store,
|
table_store,
|
||||||
block_store,
|
block_store,
|
||||||
rpc_processor,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn new_inner() -> StorageManagerInner {
|
fn new_inner() -> StorageManagerInner {
|
||||||
@ -69,6 +68,7 @@ impl StorageManager {
|
|||||||
initialized: false,
|
initialized: false,
|
||||||
local_record_store: None,
|
local_record_store: None,
|
||||||
remote_record_store: None,
|
remote_record_store: None,
|
||||||
|
rpc_processor: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,6 @@ impl StorageManager {
|
|||||||
protected_store: ProtectedStore,
|
protected_store: ProtectedStore,
|
||||||
table_store: TableStore,
|
table_store: TableStore,
|
||||||
block_store: BlockStore,
|
block_store: BlockStore,
|
||||||
rpc_processor: RPCProcessor,
|
|
||||||
) -> StorageManager {
|
) -> StorageManager {
|
||||||
StorageManager {
|
StorageManager {
|
||||||
unlocked_inner: Arc::new(Self::new_unlocked_inner(
|
unlocked_inner: Arc::new(Self::new_unlocked_inner(
|
||||||
@ -115,7 +114,6 @@ impl StorageManager {
|
|||||||
protected_store,
|
protected_store,
|
||||||
table_store,
|
table_store,
|
||||||
block_store,
|
block_store,
|
||||||
rpc_processor,
|
|
||||||
)),
|
)),
|
||||||
inner: Arc::new(AsyncMutex::new(Self::new_inner())),
|
inner: Arc::new(AsyncMutex::new(Self::new_inner())),
|
||||||
}
|
}
|
||||||
@ -148,11 +146,6 @@ impl StorageManager {
|
|||||||
|
|
||||||
inner.initialized = true;
|
inner.initialized = true;
|
||||||
|
|
||||||
// Let rpc processor access storage manager
|
|
||||||
self.unlocked_inner
|
|
||||||
.rpc_processor
|
|
||||||
.set_storage_manager(Some(self.clone()));
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,12 +156,14 @@ impl StorageManager {
|
|||||||
// Release the storage manager
|
// Release the storage manager
|
||||||
*inner = Self::new_inner();
|
*inner = Self::new_inner();
|
||||||
|
|
||||||
// Remove storage manager from rpc processor
|
|
||||||
self.unlocked_inner.rpc_processor.set_storage_manager(None);
|
|
||||||
|
|
||||||
debug!("finished storage manager shutdown");
|
debug!("finished storage manager shutdown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn set_rpc_processor(&self, opt_rpc_processor: Option<RPCProcessor>) {
|
||||||
|
let mut inner = self.inner.lock().await;
|
||||||
|
inner.rpc_processor = opt_rpc_processor
|
||||||
|
}
|
||||||
|
|
||||||
/// # DHT Key = Hash(ownerKeyKind) of: [ ownerKeyValue, schema ]
|
/// # DHT Key = Hash(ownerKeyKind) of: [ ownerKeyValue, schema ]
|
||||||
fn get_key(&self, vcrypto: CryptoSystemVersion, record: &Record) -> TypedKey {
|
fn get_key(&self, vcrypto: CryptoSystemVersion, record: &Record) -> TypedKey {
|
||||||
let compiled = record.descriptor().schema_data();
|
let compiled = record.descriptor().schema_data();
|
||||||
|
@ -135,9 +135,9 @@ impl RecordStore {
|
|||||||
async fn purge_dead_records(&mut self, lazy: bool) {
|
async fn purge_dead_records(&mut self, lazy: bool) {
|
||||||
let purge_dead_records_mutex = self.purge_dead_records_mutex.clone();
|
let purge_dead_records_mutex = self.purge_dead_records_mutex.clone();
|
||||||
let lock = if lazy {
|
let lock = if lazy {
|
||||||
match purge_dead_records_mutex.try_lock() {
|
match mutex_try_lock!(purge_dead_records_mutex) {
|
||||||
Ok(v) => v,
|
Some(v) => v,
|
||||||
Err(_) => {
|
None => {
|
||||||
// If not ready now, just skip it if we're lazy
|
// If not ready now, just skip it if we're lazy
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -204,22 +204,28 @@ fn config_callback(key: String) -> ConfigCallbackReturn {
|
|||||||
"network.rpc.queue_size" => Ok(Box::new(1024u32)),
|
"network.rpc.queue_size" => Ok(Box::new(1024u32)),
|
||||||
"network.rpc.max_timestamp_behind_ms" => Ok(Box::new(Some(10_000u32))),
|
"network.rpc.max_timestamp_behind_ms" => Ok(Box::new(Some(10_000u32))),
|
||||||
"network.rpc.max_timestamp_ahead_ms" => Ok(Box::new(Some(10_000u32))),
|
"network.rpc.max_timestamp_ahead_ms" => Ok(Box::new(Some(10_000u32))),
|
||||||
"network.rpc.timeout_ms" => Ok(Box::new(10_000u32)),
|
"network.rpc.timeout_ms" => Ok(Box::new(5_000u32)),
|
||||||
"network.rpc.max_route_hop_count" => Ok(Box::new(4u8)),
|
"network.rpc.max_route_hop_count" => Ok(Box::new(4u8)),
|
||||||
"network.rpc.default_route_hop_count" => Ok(Box::new(1u8)),
|
"network.rpc.default_route_hop_count" => Ok(Box::new(1u8)),
|
||||||
"network.dht.resolve_node_timeout_ms" => Ok(Box::new(Option::<u32>::None)),
|
"network.dht.resolve_node_timeout_ms" => Ok(Box::new(10_000u32)),
|
||||||
"network.dht.resolve_node_count" => Ok(Box::new(20u32)),
|
"network.dht.resolve_node_count" => Ok(Box::new(20u32)),
|
||||||
"network.dht.resolve_node_fanout" => Ok(Box::new(3u32)),
|
"network.dht.resolve_node_fanout" => Ok(Box::new(3u32)),
|
||||||
"network.dht.max_find_node_count" => Ok(Box::new(20u32)),
|
"network.dht.max_find_node_count" => Ok(Box::new(20u32)),
|
||||||
"network.dht.get_value_timeout_ms" => Ok(Box::new(10u32)),
|
"network.dht.get_value_timeout_ms" => Ok(Box::new(10_000u32)),
|
||||||
"network.dht.get_value_count" => Ok(Box::new(20u32)),
|
"network.dht.get_value_count" => Ok(Box::new(20u32)),
|
||||||
"network.dht.get_value_fanout" => Ok(Box::new(3u32)),
|
"network.dht.get_value_fanout" => Ok(Box::new(3u32)),
|
||||||
"network.dht.set_value_timeout_ms" => Ok(Box::new(10u32)),
|
"network.dht.set_value_timeout_ms" => Ok(Box::new(10_000u32)),
|
||||||
"network.dht.set_value_count" => Ok(Box::new(20u32)),
|
"network.dht.set_value_count" => Ok(Box::new(20u32)),
|
||||||
"network.dht.set_value_fanout" => Ok(Box::new(5u32)),
|
"network.dht.set_value_fanout" => Ok(Box::new(5u32)),
|
||||||
"network.dht.min_peer_count" => Ok(Box::new(20u32)),
|
"network.dht.min_peer_count" => Ok(Box::new(20u32)),
|
||||||
"network.dht.min_peer_refresh_time_ms" => Ok(Box::new(2_000u32)),
|
"network.dht.min_peer_refresh_time_ms" => Ok(Box::new(2_000u32)),
|
||||||
"network.dht.validate_dial_info_receipt_time_ms" => Ok(Box::new(5_000u32)),
|
"network.dht.validate_dial_info_receipt_time_ms" => Ok(Box::new(5_000u32)),
|
||||||
|
"network.dht.local_subkey_cache_size" => Ok(Box::new(128u32)),
|
||||||
|
"network.dht.local_max_subkey_cache_memory_mb" => Ok(Box::new(256u32)),
|
||||||
|
"network.dht.remote_subkey_cache_size" => Ok(Box::new(1024u32)),
|
||||||
|
"network.dht.remote_max_records" => Ok(Box::new(4096u32)),
|
||||||
|
"network.dht.remote_max_subkey_cache_memory_mb" => Ok(Box::new(64u32)),
|
||||||
|
"network.dht.remote_max_storage_space_mb" => Ok(Box::new(64u32)),
|
||||||
"network.upnp" => Ok(Box::new(false)),
|
"network.upnp" => Ok(Box::new(false)),
|
||||||
"network.detect_address_changes" => Ok(Box::new(true)),
|
"network.detect_address_changes" => Ok(Box::new(true)),
|
||||||
"network.restricted_nat_retries" => Ok(Box::new(3u32)),
|
"network.restricted_nat_retries" => Ok(Box::new(3u32)),
|
||||||
|
@ -83,14 +83,14 @@ core:
|
|||||||
max_route_hop_count: 4
|
max_route_hop_count: 4
|
||||||
default_route_hop_count: 1
|
default_route_hop_count: 1
|
||||||
dht:
|
dht:
|
||||||
resolve_node_timeout: 10000
|
resolve_node_timeout_ms: 10000
|
||||||
resolve_node_count: 20
|
resolve_node_count: 20
|
||||||
resolve_node_fanout: 3
|
resolve_node_fanout: 3
|
||||||
max_find_node_count: 20
|
max_find_node_count: 20
|
||||||
get_value_timeout: 10000
|
get_value_timeout_ms: 10000
|
||||||
get_value_count: 20
|
get_value_count: 20
|
||||||
get_value_fanout: 3
|
get_value_fanout: 3
|
||||||
set_value_timeout: 10000
|
set_value_timeout_ms: 10000
|
||||||
set_value_count: 20
|
set_value_count: 20
|
||||||
set_value_fanout: 5
|
set_value_fanout: 5
|
||||||
min_peer_count: 20
|
min_peer_count: 20
|
||||||
@ -510,7 +510,7 @@ pub struct Rpc {
|
|||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct Dht {
|
pub struct Dht {
|
||||||
pub resolve_node_timeout_ms: Option<u32>,
|
pub resolve_node_timeout_ms: u32,
|
||||||
pub resolve_node_count: u32,
|
pub resolve_node_count: u32,
|
||||||
pub resolve_node_fanout: u32,
|
pub resolve_node_fanout: u32,
|
||||||
pub max_find_node_count: u32,
|
pub max_find_node_count: u32,
|
||||||
@ -856,9 +856,9 @@ impl Settings {
|
|||||||
pk_path
|
pk_path
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_default_remote_max_subkey_cache_memory_mb() -> usize {
|
pub fn get_default_remote_max_subkey_cache_memory_mb() -> u32 {
|
||||||
let sys = sysinfo::System::new_with_specifics(sysinfo::RefreshKind::new().with_memory());
|
let sys = sysinfo::System::new_with_specifics(sysinfo::RefreshKind::new().with_memory());
|
||||||
sys.free_memory() as usize / 8
|
((sys.free_memory() / (1024u64 * 1024u64)) / 16) as u32
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_default_remote_max_storage_space_mb(inner: &SettingsInner) -> u32 {
|
pub fn get_default_remote_max_storage_space_mb(inner: &SettingsInner) -> u32 {
|
||||||
@ -1534,7 +1534,7 @@ mod tests {
|
|||||||
assert_eq!(s.core.network.rpc.max_route_hop_count, 4);
|
assert_eq!(s.core.network.rpc.max_route_hop_count, 4);
|
||||||
assert_eq!(s.core.network.rpc.default_route_hop_count, 1);
|
assert_eq!(s.core.network.rpc.default_route_hop_count, 1);
|
||||||
//
|
//
|
||||||
assert_eq!(s.core.network.dht.resolve_node_timeout_ms, None);
|
assert_eq!(s.core.network.dht.resolve_node_timeout_ms, 10_000u32);
|
||||||
assert_eq!(s.core.network.dht.resolve_node_count, 20u32);
|
assert_eq!(s.core.network.dht.resolve_node_count, 20u32);
|
||||||
assert_eq!(s.core.network.dht.resolve_node_fanout, 3u32);
|
assert_eq!(s.core.network.dht.resolve_node_fanout, 3u32);
|
||||||
assert_eq!(s.core.network.dht.max_find_node_count, 20u32);
|
assert_eq!(s.core.network.dht.max_find_node_count, 20u32);
|
||||||
|
@ -11,8 +11,9 @@ crate-type = [ "cdylib", "staticlib", "rlib" ]
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
rt-async-std = [ "async-std", "async_executors/async_std", ]
|
rt-async-std = [ "async-std", "async_executors/async_std" ]
|
||||||
rt-tokio = [ "tokio", "tokio-util", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer", ]
|
rt-tokio = [ "tokio", "tokio-util", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer" ]
|
||||||
|
rt-wasm-bindgen = [ "async_executors/bindgen", "async_executors/timer"]
|
||||||
|
|
||||||
veilid_tools_android_tests = [ "dep:paranoid-android" ]
|
veilid_tools_android_tests = [ "dep:paranoid-android" ]
|
||||||
veilid_tools_ios_tests = [ "dep:oslog", "dep:tracing-oslog" ]
|
veilid_tools_ios_tests = [ "dep:oslog", "dep:tracing-oslog" ]
|
||||||
@ -52,7 +53,7 @@ nix = "^0"
|
|||||||
wasm-bindgen = "^0"
|
wasm-bindgen = "^0"
|
||||||
js-sys = "^0"
|
js-sys = "^0"
|
||||||
wasm-bindgen-futures = "^0"
|
wasm-bindgen-futures = "^0"
|
||||||
async_executors = { version = "^0", default-features = false, features = [ "bindgen", "timer" ]}
|
async_executors = { version = "^0", default-features = false}
|
||||||
async-lock = "^2"
|
async-lock = "^2"
|
||||||
send_wrapper = { version = "^0.6", features = ["futures"] }
|
send_wrapper = { version = "^0.6", features = ["futures"] }
|
||||||
|
|
||||||
|
@ -32,6 +32,24 @@ macro_rules! bail_io_error_other {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cfg_if::cfg_if! {
|
||||||
|
if #[cfg(feature="rt-tokio")] {
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! mutex_try_lock {
|
||||||
|
($x:expr) => {
|
||||||
|
$x.try_lock().ok()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! mutex_try_lock {
|
||||||
|
($x:expr) => {
|
||||||
|
$x.try_lock()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
pub fn system_boxed<'a, Out>(
|
pub fn system_boxed<'a, Out>(
|
||||||
|
@ -10,8 +10,8 @@ crate-type = ["cdylib", "rlib"]
|
|||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "veilid-core/rt-tokio", "veilid-core/default" ]
|
default = [ "veilid-core/rt-wasm-bindgen", "veilid-core/default" ]
|
||||||
crypto-test = [ "veilid-core/rt-tokio", "veilid-core/crypto-test"]
|
crypto-test = [ "veilid-core/rt-wasm-bindgen", "veilid-core/crypto-test"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
veilid-core = { path = "../veilid-core", default-features = false }
|
veilid-core = { path = "../veilid-core", default-features = false }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user