MCPcopy Create free account
hub / github.com/Wulf/create-rust-app / queue

Function queue

crates/create-rust-app/src/tasks/mod.rs:12–24  ·  view source on GitHub ↗

Returns a reference to the synchronous queue. Tasks scheduled in this queue will be executed by the synchronous queue process. A sync queue process can be started by running the `queue` binary.

()

Source from the content-addressed store, hash-verified

10/// Tasks scheduled in this queue will be executed by the synchronous queue process.
11/// A sync queue process can be started by running the `queue` binary.
12pub fn queue() -> &'static Queue {
13 #[cfg(debug_assertions)]
14 crate::load_env_vars();
15
16 static QUEUE: OnceCell<Queue> = OnceCell::new();
17
18 QUEUE.get_or_init(|| {
19 // TODO: make the number of connections in the pool configurable
20 let db = Database::new();
21
22 Queue::builder().connection_pool(db.pool.clone()).build()
23 })
24}
25
26/// Returns a reference to the async queue.
27///

Callers 1

mainFunction · 0.85

Calls 1

load_env_varsFunction · 0.85

Tested by

no test coverage detected