async fn publish(
        &self,
        tx: NSender<Event>,
        c: Client,
        config: ResourceConfig,
        cw_client: Arc<Box<CwClient>>,
    ) {
        if let Ok(resources) = self.scan().await {
            for mut resource in resources {
                let enforcement_state = self
                    .filter_resource(&mut resource, &config, cw_client.clone())
                    .await;

                if enforcement_state == EnforcementState::Delete
                    || enforcement_state == EnforcementState::DeleteDependent
                {
                    resource.dependencies = self.dependencies(&resource).await;
                }
                resource.enforcement_state = enforcement_state;

                if let Err(err) = tx.send(Event::Resource(resource)).await {
                    error!(err = ?err, "Failed to publish event to the queue");
                }
            }
        }

        match tx.send(Event::Shutdown(c)).await {
            Ok(()) => trace!("Complete Resource Scanner"),
            Err(err) => error!(err = ?err, "Failed sending shutdown event"),
        }
    }
/// Publishes the resources to shared Channel
Publishes the resources to shared Channel
Publishes the resources to shared Channel
async fn publish(
        &self,
        tx: NSender<Event>,
        c: Client,
        config: ResourceConfig,
        cw_client: Arc<Box<CwClient>>,
    ) {
        if let Ok(resources) = self.scan().await {
            for mut resource in resources {
                let enforcement_state = self
                    .filter_resource(&mut resource, &config, cw_client.clone())
                    .await;
                if enforcement_state == EnforcementState::Delete
                    || enforcement_state == EnforcementState::DeleteDependent
                {
                    resource.dependencies = self.dependencies(&resource).await;
                }
                resource.enforcement_state = enforcement_state;
                if let Err(err) = tx.send(Event::Resource(resource)).await {
                    error!(err = ?err, "Failed to publish event to the queue");
                }
            }
        }
        match tx.send(Event::Shutdown(c)).await {
            Ok(()) => trace!("Complete Resource Scanner"),
            Err(err) => error!(err = ?err, "Failed sending shutdown event"),
        }
    }
async fn publish ( & self , tx : NSender < Event > , c : Client , config : ResourceConfig , cw_client : Arc < Box < CwClient > > , ) { if let Ok ( resources ) = self . scan ( ) . await { for mut resource in resources { let enforcement_state = self . filter_resource ( & mut resource , & config , cw_client . clone ( ) ) . await ; if enforcement_state == EnforcementState :: Delete || enforcement_state == EnforcementState :: DeleteDependent { resource . dependencies = self . dependencies ( & resource ) . await ; } resource . enforcement_state = enforcement_state ; if let Err ( err ) = tx . send ( Event :: Resource ( resource ) ) . await { error ! ( err err " " ) ; } } } match tx . send ( Event :: Shutdown ( c ) ) . await { Ok ( ( ) ) => trace ! ( " " ) , Err ( err ) => error ! ( err err " " ) , } }
Publishes the resources to shared Channel
Publishes the resources to shared Channel
&self
tx
NSender<Event>
c
Client
config
ResourceConfig
cw_client
Arc<Box<CwClient>>