MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / schedule_device_queue_batch

Function schedule_device_queue_batch

chirpstack/src/downlink/scheduler.rs:45–68  ·  view source on GitHub ↗
(size: usize)

Source from the content-addressed store, hash-verified

43}
44
45pub async fn schedule_device_queue_batch(size: usize) -> Result<()> {
46 trace!("Getting devices that have schedulable queue-items");
47 let devices = device::get_with_class_b_c_queue_items(size).await?;
48 trace!(
49 device_count = devices.len(),
50 "Got this number of devices with schedulable queue-items"
51 );
52
53 let mut handles = vec![];
54
55 for dev in devices {
56 // Spawn the batch as async tasks.
57 let handle = tokio::spawn(async move {
58 if let Err(e) = data::Data::handle_schedule_next_queue_item(dev).await {
59 error!(error = %e, "Schedule next queue-item for device failed");
60 }
61 });
62 handles.push(handle);
63 }
64
65 futures::future::join_all(handles).await;
66
67 Ok(())
68}
69
70pub async fn schedule_multicast_group_queue_batch(size: usize) -> Result<()> {
71 trace!("Getting schedulable multicast-group queue items");

Callers 3

class_b_c_scheduler_loopFunction · 0.85
run_scheduler_testFunction · 0.85
run_scheduler_testFunction · 0.85

Calls 2

pushMethod · 0.80

Tested by 2

run_scheduler_testFunction · 0.68
run_scheduler_testFunction · 0.68