2026-01-25 13:38:34 +00:00
|
|
|
pub mod actor;
|
2026-02-13 07:11:24 +00:00
|
|
|
pub mod extension;
|
2026-02-06 11:25:37 +00:00
|
|
|
pub mod worker;
|
2026-01-23 05:00:57 +00:00
|
|
|
|
2026-02-20 17:34:43 +00:00
|
|
|
// Re-export well-known environment key types for convenient access.
|
|
|
|
|
pub use actor::{SpawnTimestamp, LogicalName, ServiceBinding, ExitValue, CapabilitySet};
|
|
|
|
|
|
2026-02-06 11:25:37 +00:00
|
|
|
pub(crate) mod channel;
|
2026-01-25 13:38:34 +00:00
|
|
|
pub(crate) mod error;
|
|
|
|
|
pub use error::Error;
|
2026-01-23 05:00:57 +00:00
|
|
|
|
2026-02-13 07:11:24 +00:00
|
|
|
// Re-export identity hashing types for ActorAddress-keyed collections.
|
|
|
|
|
pub use delivery::{AddrBuildHasher, AddrMap, AddrSet};
|
2026-02-06 11:25:37 +00:00
|
|
|
|
|
|
|
|
pub mod config;
|
2026-02-07 16:51:40 +00:00
|
|
|
pub(crate) mod delivery;
|
|
|
|
|
pub mod stats;
|
2026-02-06 11:25:37 +00:00
|
|
|
|
2026-01-25 13:38:34 +00:00
|
|
|
pub mod runtime;
|
2025-11-25 00:39:17 +00:00
|
|
|
|
2026-02-09 19:05:37 +00:00
|
|
|
#[cfg(feature = "transport")]
|
|
|
|
|
pub mod transport;
|
|
|
|
|
|
2026-02-13 13:27:34 +00:00
|
|
|
// Platform-aware Instant: web_time on wasm, std::time on native.
|
|
|
|
|
// web_time is a no-op re-export of std::time::Instant on non-wasm targets.
|
|
|
|
|
#[cfg(feature = "wasm")]
|
|
|
|
|
pub(crate) use web_time::Instant;
|
|
|
|
|
#[cfg(not(feature = "wasm"))]
|
|
|
|
|
pub(crate) use std::time::Instant;
|
|
|
|
|
|
2026-01-23 05:00:57 +00:00
|
|
|
#[cfg(feature = "getrandom")]
|
2026-01-25 13:38:34 +00:00
|
|
|
pub(crate) fn get_random(buf: &mut [u8]) {
|
2026-01-23 05:00:57 +00:00
|
|
|
getrandom::getrandom(buf).unwrap()
|
|
|
|
|
}
|
2025-11-25 00:39:17 +00:00
|
|
|
|
2026-02-07 17:39:02 +00:00
|
|
|
#[cfg(all(feature = "no_random", not(feature = "getrandom")))]
|
feat: Stress tests, benchmarking, and non-failing queues and inboxes #3
Adds some basic benchmarking, stress tests. They still need to be properly examined to ensure they are testing the correct properties, but fit for "good enough". Implements the HybridChannel type, which features a channel buffer that can withstand overflows. It does so by providing a dequeue behind a mutex. Without overflow, will push messages into the lock free ArrayQueue implemented by crossbeam_queue; when that buffer fills, will use the locking portion provided by the Mutex<VecDequeue>.
In the future we can even further optimize this, perhaps with some linked list implementations of lock-free channels, but, like the benchmarks, this fits the "good enough" bar for now.
2026-01-26 07:14:00 +00:00
|
|
|
pub(crate) fn get_random(buf: &mut [u8]) {
|
|
|
|
|
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
|
|
|
|
|
|
|
|
static COUNTER: AtomicUsize = AtomicUsize::new(0);
|
|
|
|
|
|
|
|
|
|
let value = COUNTER.fetch_add(1, Ordering::Relaxed);
|
|
|
|
|
let bytes = value.to_ne_bytes();
|
|
|
|
|
|
|
|
|
|
for (i, byte) in buf.iter_mut().enumerate() {
|
|
|
|
|
*byte = bytes[i % core::mem::size_of::<usize>()];
|
|
|
|
|
}
|
|
|
|
|
}
|