2021-07-03 07:03:52 +00:00
|
|
|
pub use preserves::value;
|
|
|
|
|
|
|
|
use std::sync::atomic::AtomicU64;
|
|
|
|
use std::sync::atomic::Ordering;
|
2021-07-08 22:04:11 +00:00
|
|
|
use actor::Handle;
|
2021-07-03 07:03:52 +00:00
|
|
|
|
|
|
|
pub mod actor;
|
2020-05-11 18:51:04 +00:00
|
|
|
pub mod bag;
|
2020-05-18 11:16:14 +00:00
|
|
|
pub mod config;
|
2020-05-11 18:51:04 +00:00
|
|
|
pub mod dataspace;
|
2021-07-08 22:04:11 +00:00
|
|
|
pub mod during;
|
2021-07-03 07:03:52 +00:00
|
|
|
pub mod error;
|
|
|
|
pub mod pattern;
|
2021-07-06 18:56:36 +00:00
|
|
|
pub mod relay;
|
2021-07-15 07:13:31 +00:00
|
|
|
pub mod rewrite;
|
2021-07-06 18:56:36 +00:00
|
|
|
pub mod schemas;
|
2020-05-11 18:51:04 +00:00
|
|
|
pub mod skeleton;
|
2021-07-15 07:13:31 +00:00
|
|
|
pub mod sturdy;
|
2021-07-08 22:04:11 +00:00
|
|
|
pub mod tracer;
|
2020-05-11 18:51:04 +00:00
|
|
|
|
2021-07-15 07:13:31 +00:00
|
|
|
pub use during::entity;
|
|
|
|
|
2021-07-08 22:04:11 +00:00
|
|
|
pub use tracer::tracer;
|
|
|
|
pub use tracer::tracer_top;
|
2021-07-15 07:13:31 +00:00
|
|
|
pub use tracer::convenient_logging;
|
2021-07-03 07:03:52 +00:00
|
|
|
|
|
|
|
pub type ActorId = u64;
|
2021-07-08 22:04:11 +00:00
|
|
|
|
|
|
|
const BUMP_AMOUNT: u8 = 10;
|
|
|
|
|
|
|
|
static NEXT_ACTOR_ID: AtomicU64 = AtomicU64::new(1);
|
2021-07-03 07:03:52 +00:00
|
|
|
pub fn next_actor_id() -> ActorId {
|
2021-07-08 22:04:11 +00:00
|
|
|
NEXT_ACTOR_ID.fetch_add(BUMP_AMOUNT.into(), Ordering::Relaxed)
|
2021-07-03 07:03:52 +00:00
|
|
|
}
|
|
|
|
|
2021-07-08 22:04:11 +00:00
|
|
|
static NEXT_HANDLE: AtomicU64 = AtomicU64::new(3);
|
2021-07-03 07:03:52 +00:00
|
|
|
pub fn next_handle() -> Handle {
|
2021-07-22 08:07:49 +00:00
|
|
|
NEXT_HANDLE.fetch_add(BUMP_AMOUNT.into(), Ordering::Relaxed)
|
2021-07-03 07:03:52 +00:00
|
|
|
}
|