pub fn new(
        game: Arc<dyn ChaosGameThreadedGenerator + Send + Sync>,
    ) -> ChaosGameMoveThreadedIterator {
        let (mut tx, rx) = sync_channel::<Point>(10);
        let worker = thread::spawn(move || {
            game.generate(&mut tx);
            log::debug!("Receiver exited");
        });

        ChaosGameMoveThreadedIterator {
            rx: Some(rx),
            worker: Some(worker),
        }
    }
/// Construct a new ChaosGameMoveThreadedIterator using an instance of a ChaosGame. It will
/// launch a thread that calls ChaosGame::generate() and sends the Points it generates to the
/// iterator using a channel. The ChaosGame must be managed by an Arc in order to share the
/// ChaosGame with the thread.
Construct a new ChaosGameMoveThreadedIterator using an instance of a ChaosGame. It will
launch a thread that calls ChaosGame::generate() and sends the Points it generates to the
iterator using a channel. The ChaosGame must be managed by an Arc in order to share the
ChaosGame with the thread.
Construct a new ChaosGameMoveThreadedIterator using an instance of a ChaosGame . It will launch a thread that calls ChaosGame :: generate () and sends the Points it generates to the iterator using a channel . The ChaosGame must be managed by an Arc in order to share the ChaosGame with the thread .
pub fn new(
        game: Arc<dyn ChaosGameThreadedGenerator + Send + Sync>,
    ) -> ChaosGameMoveThreadedIterator {
        let (mut tx, rx) = sync_channel::<Point>(10);
        let worker = thread::spawn(move || {
            game.generate(&mut tx);
            log::debug!("Receiver exited");
        });
        ChaosGameMoveThreadedIterator {
            rx: Some(rx),
            worker: Some(worker),
        }
    }
pub fn new ( game : Arc < dyn ChaosGameThreadedGenerator + Send + Sync > , ) -> ChaosGameMoveThreadedIterator { let ( mut tx , rx ) = sync_channel :: < Point > ( 10 ) ; let worker = thread :: spawn ( move | | { game . generate ( & mut tx ) ; log :: debug ! ( " " ) ; } ) ; ChaosGameMoveThreadedIterator { rx : Some ( rx ) , worker : Some ( worker ) , } }
Construct a new ChaosGameMoveThreadedIterator using an instance of a ChaosGame.
Construct a new ChaosGameMoveThreadedIterator using an instance of a ChaosGame .
game
Arc<dyn ChaosGameThreadedGenerator + Send + Sync>