Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103695

why not define a EVENT_ERROR in selectors module?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From gansteed <gansteed@gmail.com>
Newsgroups comp.lang.python
Subject why not define a EVENT_ERROR in selectors module?
Date Mon, 29 Feb 2016 10:26:56 +0800
Lines 20
Message-ID <mailman.3.1456734761.20602.python-list@python.org> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de 224rfFgYn6B+vrLrHt/L8A7CfeQJPVImRmcJXfg96Gkg==
Return-Path <gansteed@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'elif': 0.04; 'definitions': 0.07; 'subject:module': 0.09; 'subject:why': 0.09; 'subject:not': 0.11; '1024)': 0.16; 'mapped': 0.16; 'poll': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'select.': 0.16; '&gt;': 0.18; '(usually': 0.22; 'this:': 0.23; 'message-id:@mail.gmail.com': 0.27; "skip:' 10": 0.28; "i'm": 0.30; 'code': 0.30; "can't": 0.32; 'maybe': 0.33; 'source': 0.33; 'add': 0.34; 'received:google.com': 0.35; 'ones': 0.35; 'generic': 0.35; 'skip:i 20': 0.36; 'received:209.85': 0.36; 'to:addr:python- list': 0.36; 'subject:?': 0.36; 'received:209': 0.38; 'skip:e 20': 0.39; 'to:addr:python.org': 0.40; 'choose': 0.68
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=+9ZAPeR6JMdLnwACKsZBb/2UZHsxZPc1qTQd0MKbzGQ=; b=ywa/7XOXa2Hf/F9O8F0TBrHcTN5M7UUgO2hnYdtMWGNiGlvOsgAXzxYE0PudmAQh47 v9V84pNN0rR5CbI+5EH8PB2i0MHnyWwVgPuDAwYo1dzGbj4TSvrR+/AGjfqi4zr7gPMB RLyoorFZqYPuTv1Tgvsw9Gm+JhnWATysQjXvcs5tnwugwf6VUckJkv6ekRh3o+qam43f lN0dTIIR53TO0dXhJ8mmz9Jgds+KKw64vhf+o5om1DRslAO3G6DS+RmN/a2Mu+8U62UE sTFvuwzxAVxWhINbH871ORgfNZK7BBWD/pLOWOOKF5i5+TTcDWMcF1/VgUZtVDWIOcff Ko6Q==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=+9ZAPeR6JMdLnwACKsZBb/2UZHsxZPc1qTQd0MKbzGQ=; b=ALbcQqsREi0Tcp95/bTH40Du7o2WAGqpd01Blj4FK5pFvX05ruDx8ddGUEr5I0oIaI 9RPLJWNpiK1iKk1ZED02BlGabQCnyIYYznkHF/ieHHnc7TowAc4SPZGlgqGqDhVOnPNy JRacyXMTlMf3mAVEI/7LiOBZ7uDaT0O31Mdf3H2lzxp8lrkZcyht5I4FVPguWF5UiV8t xqKMkToIFHI9ncgW1BC9jM9tHIhfIUHDUdPO64yGtMvpNBo90PpBr6g7gXSNn3Wjzuy8 fANXTRdeV5jPXdNL/54TxqwczLNCA+nYe7bjBvShDrc0cFz+cGrscCjpMjPiv+ZvWWlG l2fg==
X-Gm-Message-State AG10YOQ3tqnQwPd6EEz2hAm/svJ6+5ZVoCPHRHjGD87xjfwsuQ62AG0c1zozy/wShThyp48KBCHFdq+sFPUUkQ==
X-Received by 10.107.164.15 with SMTP id n15mr15729858ioe.148.1456712816372; Sun, 28 Feb 2016 18:26:56 -0800 (PST)
X-Mailman-Approved-At Mon, 29 Feb 2016 03:32:39 -0500
X-Content-Filtered-By Mailman/MimeDel 2.1.21
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:103695

Show key headers only | View raw


as the title:

    I'm reading the source code of selectors, I got this:

# generic events, that must be mapped to implementation-specific ones
EVENT_READ = (1 << 0)
EVENT_WRITE = (1 << 1)

    maybe we can add definitions for EVENT_ERROR like this:

# Choose the best implementation, roughly:
#    epoll|kqueue|devpoll > poll > select.
# select() also can't accept a FD > FD_SETSIZE (usually around 1024)
if 'KqueueSelector' in globals():
    DefaultSelector = KqueueSelector
    EVENT_ERROR = EVENT_WRITE << 1
elif 'EpollSelector' in globals():
    ...
elif ...:
    ...

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

why not define a EVENT_ERROR in selectors module? gansteed <gansteed@gmail.com> - 2016-02-29 10:26 +0800

csiph-web