def _poll_for(fd, readable, writable, error, timeout):
 event_mask = 0
 if readable:
  event_mask |= select.POLLIN
 if writable:
  event_mask |= select.POLLOUT
 if error:
  event_mask |= select.POLLERR
 pollable = select.poll()
 pollable.register(fd, event_mask)
 if timeout:
  event_list = pollable.poll(long((timeout * 1000)))
 else:
  event_list = pollable.poll()
 return bool(event_list)

def _poll_for ( fd , readable , writable , error , timeout ) : event_mask = 0 if readable : event_mask |= select . POLLIN if writable : event_mask |= select . POLLOUT if error : event_mask |= select . POLLERR pollable = select . poll ( ) pollable . register ( fd , event_mask ) if timeout : event_list = pollable . poll ( long ( ( timeout * 1000 ) ) ) else : event_list = pollable . poll ( ) return bool ( event_list )
poll polling backend .