1) I went to the examples directory and looked at the
helloword-wsgi-app.py. The first thing I noticed was how many times I
saw "proactor" (proactor_resolution, proactor_greedy,
proactor_multiplex_first). After looking at cogen/core/proactors/*.py,
it made me wonder whether "proactor" is actually a bit of a misnomer.
I'm not a huge design patterns guy, so I could be wrong, but the
following page seems to say that reactors are for select/poll sorts of
stuff, and proactors are for when the kernel itself does IO.
http://www.artima.com/articles/io_design_patterns2.html
From this description, it sounds like what Cogen does isn't exactly a
reactor or a proactor but a sort of hybrid. It's not a hugely important
issue, but I am curious if there's more to it.
2) I was a bit confused when I saw has_ctypes_iocp (in
proactors/__init__.py) because it returns CTYPES_IOCPProactor as long as
there's no ImportError. Within the context of __init__.py, it seemed
like it should always be possible to import ctypes and ctypes_iocp_impl
regardless of whether this implementation is available. When running it
by hand, though, I noticed that the actual ImportError raised is
"ImportError: cannot import name WINFUNCTYPE". It works, but it seemed
a little misleading.
3) It looks like there's a genuine bug on line 63 of
proactors/__init__.py in has_iocp. Shouldn't that be a return rather
than a pass?
Thanks.
--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868
Fair enough. It still sets off my buzzword alarm but at least it makes
sense. :)
> 2) I want to enforce as less as possible. One should use the has_blabla()
> to check if a specific implementation is available. If you directly import
> the class you do it at your own peril.
Sorry, I should rephrase my comment.
It seems like it would be a little more consistent with the surrounding
code if it looked something like this:
import ctypes
from ctypes import WINFUNCTYPE
import ctypes_iocp_impl
I was confused when I read the original because it made it look like the
only condition needed was that ctypes could be successfully imported,
but it's actually importing WINFUNCTYPE that seems to make it fail on my
machine. It's not a big deal, I just thought I would mention it.