pub fn do_thinking(&self) {
        // check if there is a new Thought available in the channel
        if let Some(ref receiver) = self.receiver {
            //info!("starte thinking");
            loop {
                while let Ok(thought) = receiver.recv() {
                    // create the Waker from the current Thought
                    let waker = Wakeable::into_waker(&thought);
                    // create the Context from the given Waker
                    let mut context = Context::from_waker(&waker);
                    // lock the Future contained in the Thought and poll it
                    let mut thinkable = thought.thinkable.lock();
                    if let Poll::Pending = thinkable.as_mut().poll(&mut context) {
                        // if the state is Poll::Pending we just unlock the Future
                        drop(thinkable);
                        // in case it will be still valid and required to re-process this
                        // Thought the Waker will re-send it through the channel
                    }
                }
            }
        }
    }
/// Do the actual thinking - check for Thoughts that waits for processing
/// and drive them to completion
Do the actual thinking - check for Thoughts that waits for processing
and drive them to completion
Do the actual thinking - check for Thoughts that waits for processing and drive them to completion
pub fn do_thinking(&self) {
        // check if there is a new Thought available in the channel
        if let Some(ref receiver) = self.receiver {
            //info!("starte thinking");
            loop {
                while let Ok(thought) = receiver.recv() {
                    // create the Waker from the current Thought
                    let waker = Wakeable::into_waker(&thought);
                    // create the Context from the given Waker
                    let mut context = Context::from_waker(&waker);
                    // lock the Future contained in the Thought and poll it
                    let mut thinkable = thought.thinkable.lock();
                    if let Poll::Pending = thinkable.as_mut().poll(&mut context) {
                        // if the state is Poll::Pending we just unlock the Future
                        drop(thinkable);
                        // in case it will be still valid and required to re-process this
                        // Thought the Waker will re-send it through the channel
                    }
                }
            }
        }
    }
pub fn do_thinking ( & self ) { // check if there is a new Thought available in the channel if let Some ( ref receiver ) = self . receiver { //info!("starte thinking"); loop { while let Ok ( thought ) = receiver . recv ( ) { // create the Waker from the current Thought let waker = Wakeable :: into_waker ( & thought ) ; // create the Context from the given Waker let mut context = Context :: from_waker ( & waker ) ; // lock the Future contained in the Thought and poll it let mut thinkable = thought . thinkable . lock ( ) ; if let Poll :: Pending = thinkable . as_mut ( ) . poll ( & mut context ) { // if the state is Poll::Pending we just unlock the Future drop ( thinkable ) ; // in case it will be still valid and required to re-process this // Thought the Waker will re-send it through the channel } } } } }
Do the actual thinking - check for Thoughts that waits for processing
and drive them to completion
Do the actual thinking - check for Thoughts that waits for processing and drive them to completion
&self
&self