pub fn add(&mut self, project: Project) {
        let (tx, rx) = chan::unbounded();
        let build_events_tx = self.build_events_tx.clone();
        let extra_nix_options = self.extra_nix_options.clone();

        self.handler_threads
            .entry(project.nix_file.clone())
            .or_insert_with(|| Handler {
                tx,
                _handle: std::thread::spawn(move || {
                    let mut build_loop = BuildLoop::new(&project, extra_nix_options);

                    // cloning the tx means the daemon’s rx gets all
                    // messages from all builders.
                    build_loop.forever(build_events_tx, rx);
                }),
            })
            // Notify the handler, whether or not it was newly added
            .tx
            .send(())
            .unwrap();
    }
/// Add nix file to the set of files this daemon watches
/// & build if they change.
Add nix file to the set of files this daemon watches
& build if they change.
Add nix file to the set of files this daemon watches & build if they change .
pub fn add(&mut self, project: Project) {
        let (tx, rx) = chan::unbounded();
        let build_events_tx = self.build_events_tx.clone();
        let extra_nix_options = self.extra_nix_options.clone();
        self.handler_threads
            .entry(project.nix_file.clone())
            .or_insert_with(|| Handler {
                tx,
                _handle: std::thread::spawn(move || {
                    let mut build_loop = BuildLoop::new(&project, extra_nix_options);
                    // cloning the tx means the daemon’s rx gets all
                    // messages from all builders.
                    build_loop.forever(build_events_tx, rx);
                }),
            })
            // Notify the handler, whether or not it was newly added
            .tx
            .send(())
            .unwrap();
    }
pub fn add ( & mut self , project : Project ) { let ( tx , rx ) = chan :: unbounded ( ) ; let build_events_tx = self . build_events_tx . clone ( ) ; let extra_nix_options = self . extra_nix_options . clone ( ) ; self . handler_threads . entry ( project . nix_file . clone ( ) ) . or_insert_with ( | | Handler { tx , _handle : std :: thread :: spawn ( move | | { let mut build_loop = BuildLoop :: new ( & project , extra_nix_options ) ; // cloning the tx means the daemon’s rx gets all // messages from all builders. build_loop . forever ( build_events_tx , rx ) ; } ) , } ) // Notify the handler, whether or not it was newly added . tx . send ( ( ) ) . unwrap ( ) ; }
Add nix file to the set of files this daemon watches
& build if they change.
Add nix file to the set of files this daemon watches & build if they change .
&mut self
project
Project
&mut self
project
Project