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


Groups > comp.lang.python > #84601

Re: HTTP over Asynchronous AF_UNIX Socket in python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: HTTP over Asynchronous AF_UNIX Socket in python
Date Mon, 26 Jan 2015 16:12:12 +0200
Organization A noiseless patient Spider
Lines 27
Message-ID <87siexeimb.fsf@elektro.pacujo.net> (permalink)
References <mailman.18146.1422279152.18130.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="1960"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XzamdsvWrPxrGjmKMFk+/"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:fhipV+bkv5ixj79DQg5Ox9H77O0= sha1:iWpegsCv7AXq8DXc9h3dzCnsPtA=
Xref csiph.com comp.lang.python:84601

Show key headers only | View raw


Norah Jones <nh.jones01@gmail.com>:

> But this cannot work since normal socket will not work and thus i
> thought of `asyncore` module in python. To use asyncore module again i
> will have to subclass asyncore.dispatcher. This class also contains
> connect() method.
>
> Another problem is I don't know how asyncore module works and thus not
> able to find a way to mix the work of 1) listening forever, accept the
> connection, store id and the sock_fd.
> 2) accept data from the process' agent sister process, retrieve the
> sock_fd by matching the id in the dictionary and send it through the
> AF_UNIX socket.

Asyncore was a nice idea, but you shouldn't build anything on top of it.
The newest Python versions have moved to a scheme called asyncio. Its
programming model is a bit unconventional and hasn't won me over yet.

Personally, I have found select.epoll(EPOLLET) plus a timer
implementation enough of a framework for all of my async needs.

Then comes HTTP support. The stdlib networking facilities are great for
quick scripting, but not really compatible with the asynchronous
paradigm. I have coded my protocols by hand myself.


Marko

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


Thread

HTTP over Asynchronous AF_UNIX Socket in python Norah Jones <nh.jones01@gmail.com> - 2015-01-26 13:32 +0000
  Re: HTTP over Asynchronous AF_UNIX Socket in python Marko Rauhamaa <marko@pacujo.net> - 2015-01-26 16:12 +0200

csiph-web