/// Asynchronously wait on certain events happening on a FileHandle.
Asynchronously wait on certain events happening on a FileHandle.
Asynchronously wait on certain events happening on a FileHandle .
pub fn add(&self, file: &FileHandle, epoll_event: EpollEvent) -> Result<(), Errno> {
        let mut waits = self.wait_objects.write();
        let key = as_epoll_key(&file);
        match waits.entry(key) {
            Entry::Occupied(_) => return error!(EEXIST),
            Entry::Vacant(entry) => {
                let wait_object = entry.insert(WaitObject {
                    target: file.clone(),
                    events: FdEvents::from(epoll_event.events),
                    data: epoll_event.data,
                });
                // if not waiting, put this on the rearm_queue?
                self.wait_on_file(key, wait_object)
            }
        }
    }
pub fn add ( & self , file : & FileHandle , epoll_event : EpollEvent ) -> Result < ( ) , Errno > { let mut waits = self . wait_objects . write ( ) ; let key = as_epoll_key ( & file ) ; match waits . entry ( key ) { Entry :: Occupied ( _ ) => return error ! ( EEXIST ) , Entry :: Vacant ( entry ) => { let wait_object = entry . insert ( WaitObject { target : file . clone ( ) , events : FdEvents :: from ( epoll_event . events ) , data : epoll_event . data , } ) ; // if not waiting, put this on the rearm_queue? self . wait_on_file ( key , wait_object ) } } }
Asynchronously wait on certain events happening on a FileHandle.
Asynchronously wait on certain events happening on a FileHandle .
&self
file
&FileHandle
epoll_event
EpollEvent