1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! In-memory [`SchedulerStore`](chronon_core::SchedulerStore) for tests and local development.
//!
//! Process-local, **non-durable** storage. Suitable for **embedded** boots, examples, e2e, and
//! benchmarks — **not** for multi-process coordinator–worker clusters (`mem` does not cross
//! process boundaries).
//!
//! Getting started on the public crate:
//! [Embedded](https://docs.rs/uf-chronon/latest/chronon/index.html#embedded-one-process).
//!
//! ## Entry points
//!
//! - [`InMemorySchedulerStore::new`] — create a standalone store
//! - [`install_default_mem_store`] — register as the process-global default on [`StoreRouter`]
//!
//! Enable the `mem` feature on the `chronon` crate to re-export these types.
//!
//! ## Embedded
//!
//! Wire with `ChrononBuilder::scheduler_store(Arc::new(InMemorySchedulerStore::new())).embedded()`
//! on the `chronon` crate (`mem` feature).
//!
//! ```ignore
//! use std::sync::Arc;
//! use chronon::prelude::*;
//! use chronon::InMemorySchedulerStore;
//!
//! let chronon = ChrononBuilder::new()
//! .scheduler_store(Arc::new(InMemorySchedulerStore::new()))
//! .context_factory(Arc::new(JsonScriptContextFactory))
//! .embedded()
//! .auto_registry()
//! .build()?;
//! ```
//!
//! Runnable: `cargo run -p uf-chronon --example script_macro --features mem`.
pub use InMemorySchedulerStore;
use Arc;
use ;
/// Registers a new in-memory store as the global default.
///
/// Returns the shared store handle so callers can pre-seed jobs or pass it to
/// `ChrononBuilder::scheduler_store` in `chronon-runtime`.
///
/// # Examples
///
/// ```
/// use chronon_backend_mem::install_default_mem_store;
/// use chronon_core::default_store_from_global;
///
/// let _store = install_default_mem_store();
/// assert!(default_store_from_global().is_ok());
/// ```