@@ -17,6 +17,7 @@ use redis::{acl::Rule, AsyncCommands};
1717use sea_orm:: DatabaseConnection ;
1818use serde:: { Deserialize , Serialize } ;
1919use time:: Duration ;
20+ #[ cfg( not( feature = "crossfire-channel" ) ) ]
2021use tokio:: sync:: mpsc:: { UnboundedReceiver , UnboundedSender } ;
2122use tokio_util:: sync:: CancellationToken ;
2223use tracing_subscriber:: { layer:: SubscriberExt , util:: SubscriberInitExt , Layer } ;
@@ -197,7 +198,8 @@ impl CoordinatorConfig {
197198 pub fn build_worker_task_queue (
198199 & self ,
199200 cancel_token : CancellationToken ,
200- rx : UnboundedReceiver < TaskDispatcherOp > ,
201+ #[ cfg( not( feature = "crossfire-channel" ) ) ] rx : UnboundedReceiver < TaskDispatcherOp > ,
202+ #[ cfg( feature = "crossfire-channel" ) ] rx : crossfire:: AsyncRx < TaskDispatcherOp > ,
201203 ) -> TaskDispatcher {
202204 TaskDispatcher :: new ( cancel_token, rx)
203205 }
@@ -206,7 +208,8 @@ impl CoordinatorConfig {
206208 & self ,
207209 cancel_token : CancellationToken ,
208210 pool : InfraPool ,
209- rx : UnboundedReceiver < HeartbeatOp > ,
211+ #[ cfg( not( feature = "crossfire-channel" ) ) ] rx : UnboundedReceiver < HeartbeatOp > ,
212+ #[ cfg( feature = "crossfire-channel" ) ] rx : crossfire:: AsyncRx < HeartbeatOp > ,
210213 ) -> HeartbeatQueue {
211214 HeartbeatQueue :: new ( cancel_token, self . heartbeat_timeout , pool, rx)
212215 }
@@ -273,8 +276,18 @@ impl CoordinatorConfig {
273276
274277 pub async fn build_infra_pool (
275278 & self ,
276- worker_task_queue_tx : UnboundedSender < TaskDispatcherOp > ,
277- worker_heartbeat_queue_tx : UnboundedSender < HeartbeatOp > ,
279+ #[ cfg( not( feature = "crossfire-channel" ) ) ] worker_task_queue_tx : UnboundedSender <
280+ TaskDispatcherOp ,
281+ > ,
282+ #[ cfg( feature = "crossfire-channel" ) ] worker_task_queue_tx : crossfire:: MTx <
283+ TaskDispatcherOp ,
284+ > ,
285+ #[ cfg( not( feature = "crossfire-channel" ) ) ] worker_heartbeat_queue_tx : UnboundedSender <
286+ HeartbeatOp ,
287+ > ,
288+ #[ cfg( feature = "crossfire-channel" ) ] worker_heartbeat_queue_tx : crossfire:: MTx <
289+ HeartbeatOp ,
290+ > ,
278291 ) -> crate :: error:: Result < InfraPool > {
279292 let db = sea_orm:: Database :: connect ( & self . db_url ) . await ?;
280293 let credential = Credentials :: new (
@@ -399,8 +412,14 @@ impl CoordinatorConfig {
399412pub struct InfraPool {
400413 pub db : DatabaseConnection ,
401414 pub s3 : S3Client ,
415+ #[ cfg( not( feature = "crossfire-channel" ) ) ]
402416 pub worker_task_queue_tx : UnboundedSender < TaskDispatcherOp > ,
417+ #[ cfg( feature = "crossfire-channel" ) ]
418+ pub worker_task_queue_tx : crossfire:: MTx < TaskDispatcherOp > ,
419+ #[ cfg( not( feature = "crossfire-channel" ) ) ]
403420 pub worker_heartbeat_queue_tx : UnboundedSender < HeartbeatOp > ,
421+ #[ cfg( feature = "crossfire-channel" ) ]
422+ pub worker_heartbeat_queue_tx : crossfire:: MTx < HeartbeatOp > ,
404423}
405424
406425#[ derive( Debug ) ]
0 commit comments