/// Starts an async task that fills the slice pool in the background.
Starts an async task that fills the slice pool in the background.
Starts an async task that fills the slice pool in the background .
pub fn start(
        pool: Arc<Mutex<CertifiedSlicePool>>,
        endpoint_resolver: XNetEndpointResolver,
        xnet_client: Arc<dyn XNetClient>,
        runtime_handle: runtime::Handle,
        metrics: Arc<XNetPayloadBuilderMetrics>,
        log: ReplicaLogger,
    ) -> RefillTaskHandle {
        let (refill_trigger, mut refill_receiver) = mpsc::channel(1);
        let task = Self {
            pool,
            endpoint_resolver,
            xnet_client,
            runtime_handle: runtime_handle.clone(),
            metrics,
            log,
        };
        runtime_handle.spawn(async move {
            while refill_receiver.recv().await.is_some() {
                task.refill_pool(POOL_BYTE_SIZE_SOFT_CAP, POOL_SLICE_BYTE_SIZE_MAX)
                    .await;
            }
        });
        RefillTaskHandle(Mutex::new(refill_trigger))
    }
pub fn start ( pool : Arc < Mutex < CertifiedSlicePool > > , endpoint_resolver : XNetEndpointResolver , xnet_client : Arc < dyn XNetClient > , runtime_handle : runtime :: Handle , metrics : Arc < XNetPayloadBuilderMetrics > , log : ReplicaLogger , ) -> RefillTaskHandle { let ( refill_trigger , mut refill_receiver ) = mpsc :: channel ( 1 ) ; let task = Self { pool , endpoint_resolver , xnet_client , runtime_handle : runtime_handle . clone ( ) , metrics , log , } ; runtime_handle . spawn ( async move { while refill_receiver . recv ( ) . await . is_some ( ) { task . refill_pool ( POOL_BYTE_SIZE_SOFT_CAP , POOL_SLICE_BYTE_SIZE_MAX ) . await ; } } ) ; RefillTaskHandle ( Mutex :: new ( refill_trigger ) ) }
Starts an async task that fills the slice pool in the background.
Starts an async task that fills the slice pool in the background .
pool
Arc<Mutex<CertifiedSlicePool>>
endpoint_resolver
XNetEndpointResolver
xnet_client
Arc<dyn XNetClient>
runtime_handle
runtime::Handle
metrics
Arc<XNetPayloadBuilderMetrics>
log
ReplicaLogger