poll class in python

poll class of socket module provides methods for registering, unregistering for I/O events and polling for them for a specific number of milli seconds.

Poll Updated 17 Oct 2018 1 min read

Overview

While the select module provides the method select.poll(), which returns an instance of class poll, The poll class present in the select module provides methods that help in the aspects of the polling. That is registering for I/O events and poll for them to process the I/O as and when the I/O events occur during the polling.

List of methods of the class select.poll

MethodDescription
poll.registerRegisters I/O events for a file descriptor.
poll.unregisterUnregisters the already registered I/O events for a file descriptor.
poll.modifyUnregisters the already registered I/O events for a file descriptor and registers the new set of I/O events.
poll.pollPolls for a set of registered I/O events