Skip to content

Commit c8eaf23

Browse files
committed
Move structs below the run_worker func
1 parent 472be4b commit c8eaf23

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

crates/fluxqueue-worker/src/worker.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ use crate::redis_client::RedisClient;
1414
use crate::task::{PythonDispatcher, TaskRegistry};
1515
use fluxqueue_common::{Task, deserialize_raw_task_data};
1616

17-
struct ExecutorContext {
18-
queue_name: Arc<str>,
19-
executor_id: Arc<str>,
20-
redis_client: Arc<RedisClient>,
21-
task_registry: Arc<TaskRegistry>,
22-
python_dispatcher: Arc<PythonDispatcher>,
23-
}
24-
25-
struct ReadyCheck {
26-
concurrency: Arc<AtomicUsize>,
27-
counter: Arc<AtomicUsize>,
28-
}
29-
3017
pub async fn run_worker(
3118
mut shutdown: watch::Receiver<bool>,
3219
concurrency: usize,
@@ -148,6 +135,19 @@ pub async fn run_worker(
148135
Ok(())
149136
}
150137

138+
struct ExecutorContext {
139+
queue_name: Arc<str>,
140+
executor_id: Arc<str>,
141+
redis_client: Arc<RedisClient>,
142+
task_registry: Arc<TaskRegistry>,
143+
python_dispatcher: Arc<PythonDispatcher>,
144+
}
145+
146+
struct ReadyCheck {
147+
concurrency: Arc<AtomicUsize>,
148+
counter: Arc<AtomicUsize>,
149+
}
150+
151151
async fn executor_loop(
152152
mut shutdown: watch::Receiver<bool>,
153153
ready_check: ReadyCheck,

0 commit comments

Comments
 (0)