[issue30844] selectors: Add urgent data to read event

2017-11-03 Thread Pim Klanke
Pim Klanke added the comment: On 02-11-17 16:54, STINNER Victor wrote: > STINNER Victor added the comment: > > It seems like kqueue supports urgent data: > > "EV_OOBAND: Read filter on socket may set this flag to indicate the presence > of out of band data on the descriptor." > > Example: > h

[issue30844] selectors: Add urgent data to read event

2017-11-02 Thread STINNER Victor
STINNER Victor added the comment: It seems like kqueue supports urgent data: "EV_OOBAND: Read filter on socket may set this flag to indicate the presence of out of band data on the descriptor." Example: https://github.com/daurnimator/cqueues/commit/52baaf1c25bc7e6f7cb4685cb05f4ed47a3f404a B

[issue30844] selectors: Add urgent data to read event

2017-09-27 Thread Pim Klanke
Pim Klanke added the comment: On 26-09-17 14:13, STINNER Victor wrote: > > STINNER Victor added the comment: > > It would help to look how Twisted, eventlet, gevent and others handle "urgent > data" and "exceptions". First of all, there are no exceptions, only "exceptional conditions". Seco

[issue30844] selectors: Add urgent data to read event

2017-09-27 Thread Pim Klanke
Pim Klanke added the comment: On 26-09-17 14:01, STINNER Victor wrote: > > STINNER Victor added the comment: > > Anothe piece of history, the creation of the selectors module, bpo-16853, > directly with the win32 "select.select(r, w, w, timeout)": > > commit 243d8d85debaa319a2be0143003a9e881

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread Pim Klanke
Pim Klanke added the comment: On 26-09-17 14:10, STINNER Victor wrote: > > STINNER Victor added the comment: > > On Windows, exceptfds of select() is not only related to urgent ("out of > band") data, it also notifies connect() failure: > > exceptfds: > > If processing a connect call (

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor
STINNER Victor added the comment: It would help to look how Twisted, eventlet, gevent and others handle "urgent data" and "exceptions". Check if they succeeded to formalize these events. asyncore uses select() or poll(). asyncore.poll() uses select.select(). It adds the fd to exceptfds if the

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor
STINNER Victor added the comment: On Windows, exceptfds of select() is not only related to urgent ("out of band") data, it also notifies connect() failure: exceptfds: If processing a connect call (nonblocking), connection attempt failed. OOB data is available for reading (only if SO_OO

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor
STINNER Victor added the comment: Anothe piece of history, the creation of the selectors module, bpo-16853, directly with the win32 "select.select(r, w, w, timeout)": commit 243d8d85debaa319a2be0143003a9e881a0f5646 Author: Charles-François Natali Date: Wed Sep 4 19:02:49 2013 +0200 Issu

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread Pim Klanke
Pim Klanke added the comment: On 26-09-17 12:29, STINNER Victor wrote: > > STINNER Victor added the comment: > > Using Git history, I found the following commit which added "r, w, x = > select(r, w, w, timeout)" for Windows in tulip (old name of the asyncio > project, when it was developed ou

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread Pim Klanke
Pim Klanke added the comment: On 26-09-17 11:51, STINNER Victor wrote: > > STINNER Victor added the comment: > > I'm not confortable with the change because of following questions: > > * It seems like your patch changes the SelectSelector behaviour on Windows. > How is a selectors user suppos

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor
STINNER Victor added the comment: Using Git history, I found the following commit which added "r, w, x = select(r, w, w, timeout)" for Windows in tulip (old name of the asyncio project, when it was developed outside CPython): commit 84124f3d725c9931249d083e78f43fcda91c383a Author: Richard Oudk

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor
STINNER Victor added the comment: I'm not confortable with the change because of following questions: * It seems like your patch changes the SelectSelector behaviour on Windows. How is a selectors user supposed to upgrade his/her code to get the same behaviour on Python 3.6 and 3.7? Would it m

[issue30844] selectors: Add urgent data to read event

2017-09-22 Thread Pim Klanke
Pim Klanke added the comment: In the selectors module, the winsock select method is wrapped. The second parameter (writefds) is passed to both writefds and exceptfds and the returned number of fds for write and except are summed and returned in the second element of the tuple. Can anyone expl

[issue30844] selectors: Add urgent data to read event

2017-07-05 Thread Pim Klanke
Pim Klanke added the comment: I'm confused about the wrapper method around winsock select and curious to why this is necessary. I have send an email to neologix to share some light on the subject. -- ___ Python tracker

[issue30844] selectors: Add urgent data to read event

2017-07-05 Thread STINNER Victor
STINNER Victor added the comment: Pim Klanke: "(...) IMO there is no need to handle urgent data events of all file objects, before handling other events." Hum, ok. So no need to extend the selectors API for that. I also understand that it's better to let applications decide how to prioritize t

[issue30844] selectors: Add urgent data to read event

2017-07-05 Thread Pim Klanke
Pim Klanke added the comment: > "The selectors API returns a list of (key, events) tuples. So an application > has to iterate on this list twice?" No. "urgent data" means 'urgent' towards other events for thís key (key being the file object), not towards events for other file objects. AFAIK

[issue30844] selectors: Add urgent data to read event

2017-07-05 Thread STINNER Victor
STINNER Victor added the comment: > "urgent data", "High-priority data" How is an application supposed to handle these data? Read them before any other data? The selectors API returns a list of (key, events) tuples. So an application has to iterate on this list twice? A first time to look for

[issue30844] selectors: Add urgent data to read event

2017-07-04 Thread Pim Klanke
Changes by Pim Klanke : -- title: selectors: Add exceptional conditions event -> selectors: Add urgent data to read event ___ Python tracker ___