def add_writer(self, fd, callback, *args):
self._check_closed()<EOL>try:<EOL><INDENT>existing = self._write_notifiers[fd]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>existing.setEnabled(False)<EOL>existing.activated.disconnect()<EOL><DEDENT>notifier = QtCore.QSocketNotifier(fd, QtCore.QSocketNotifier.Write)<EOL>notifier.setEnabled(True)<EOL>self._logger.debug('<STR_LIT>'.format(fd))<EOL>notifier.activated.connect(<EOL>lambda: self.__on_notifier_ready(<EOL>self._write_notifiers, notifier, fd, callback, args)  <EOL>)<EOL>self._write_notifiers[fd] = notifier<EOL>
Register a callback for when a file descriptor is ready for writing.