Returns a reference to the async queue. Tasks scheduled in this queue will be executed by the async queue process. An async queue process can be started by running the `async_queue` binary (this is the default for newly generated projects). Make sure you connect this queue to your db at the start of your app: ```rust let queue = async_queue(); queue.lock().unwrap().connect(NoTls).await.expect("F
()
| 34 | /// queue.lock().unwrap().connect(NoTls).await.expect("Failed to connect to queue DB"); |
| 35 | /// ``` |
| 36 | pub fn async_queue() -> &'static Mutex<AsyncQueue<NoTls>> { |
| 37 | static ASYNC_QUEUE: OnceCell<Mutex<AsyncQueue<NoTls>>> = OnceCell::new(); |
| 38 | |
| 39 | ASYNC_QUEUE.get_or_init(|| { |
| 40 | Mutex::new(create_async_queue(10 /* r2d2's default */)) |
| 41 | }) |
| 42 | } |
| 43 | |
| 44 | /// Creates a new async queue with the specified max pool size. |
| 45 | /// You should not need to use this function directly. |
nothing calls this directly
no test coverage detected