[Web-SIG] WSGI and asyncio (tulip)?

Antoine Pitrou solipsis at pitrou.net
Wed Oct 15 00:58:52 CEST 2014


On Wed, 15 Oct 2014 11:28:42 +1300
Robert Collins
<robertc at robertcollins.net> wrote:
> On 15 October 2014 11:10, Antoine Pitrou <solipsis at pitrou.net> wrote:
> 
> > Each time a connection is accepted, protocol_factory is called without
> > arguments(**) to create a Protocol, a bidirectional stream Transport is
> > created to represent the network side of the connection, and the two
> > are tied together by calling protocol.connection_made(transport)."""
> 
> So where would headers etc be supplied to the protocol for reads (and
> for outputs)? Since the transport isn't the raw socket, its the bodies
> only.

For reads, it could be provided on e.g.
transport.get_extra_info('headers'). Or if you want a flat mapping API,
transport.get_extra_info('http_content_type'), etc.

As for out-bound headers, it's a good question. But I think it's ok for
the transport to have HTTP-specific methods, so
transport.write_header(name, value) could be ok too.

Regards

Antoine.




More information about the Web-SIG mailing list