Re: Websockets... again

2014-10-30 Thread Justin Holmes
Luis,

I think what Alex and Aymeric are saying is that "websockets" (I use
quotes to show that I mean not only the material outlined in RFC 6455
but also the general process of handling bytes-on-the-wire when
'pushing' data to the 'client') are ideally not part of the problem
that Django (and WSGI applications generally) are trying to solve.
Correct me if I'm wrong, gentlemen.

Alex and Aymeric gave really stellar talks on this topic, at PyCon.us
2010 and Djangocon.us 2013 respectively, and they're really worth
going back and watching.  Of course Aymeric also maintains a websocket
library (https://github.com/aaugustin/websockets).

At the end of the day, handling bytes-on-the-wire is really fun when
done on a different layer than your web MVC application.  Colin
mentioned Hendrix - a Twisted container for Django.  Instead of trying
to "do async" inside of WSIG, Hendrix (and some other WSGI containers)
allow you to run other python applications alongside your WSGI
application.

For example, I have a project called Cirque that uses Hendrix to both
serve a WSGI application (Django) and listen for mesh network traffic
on a UDP port.  It reports mesh traffic to the Django application and
communicates directly with the websockets opened on the
Django-delivered resources.

This way, Django doesn't even need to realize that anything "async" is
happening.

It is also definitely worth paying attention to the web-sig mailing
list.  As you can see, October has been mostly talk of what we want in
the next WSGI 
(https://mail.python.org/pipermail/web-sig/2014-October/thread.html).

This post is starting to grow beyond the django-dev topic.  If you
want to know more about the how's and why's, feel free to post in
django-users.  As far as django development, there seems to be no
compelling argument, at least so far, to change Django's disposition
to make it "async."

On Wed, Oct 29, 2014 at 9:38 AM, Alex Gaynor  wrote:
> And after you throw away the ORM, you have to throw away every other library
> that does blocking IO (anything in the stdlib, memcached, redis, requests,
> etc.). There are absolutely no affordances in WSGI for use with non-blocking
> libraries like asyncio or Twisted.
>
> Alex
>
>
> On Wed Oct 29 2014 at 1:45:59 AM Aymeric Augustin
>  wrote:
>>
>> Then the first step is to throw away the ORM.
>>
>> See my talk at DjangoCon US 2013 for details.
>>
>> --
>> Aymeric.
>>
>> Le 28 oct. 2014 à 23:36, Marco Paolini  a écrit :
>>
>> What if we do it with asyncio?
>>
>> 2014-10-28 22:47 GMT+01:00 Aymeric Augustin
>> :
>>>
>>> No, there isn’t.
>>>
>>> I assume that “including in core” means at least “making usable in
>>> combination with WSGI and with the ORM”.
>>>
>>> Even if we disregard for a minute the fact that WSGI is incompatible with
>>> websockets, the ORM is a hard problem, because current solutions involve
>>> either (a) threads — not particularly scalable or (b) gevent — not
>>> particularly reliable.
>>>
>>> --
>>> Aymeric.
>>>
>>>
>>>
>>> On 28 oct. 2014, at 22:06, Luis Masuelli  wrote:
>>>
>>> Is there any current development involving including websockets in django
>>> core?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/50768d16-1d05-489c-8cbf-2091d95ff388%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/7D3898D4-50F7-4ACE-A081-0ACC9D824191%40polytechnique.org.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> 

Re: Websockets... again

2014-10-29 Thread Alex Gaynor
And after you throw away the ORM, you have to throw away every other
library that does blocking IO (anything in the stdlib, memcached, redis,
requests, etc.). There are absolutely no affordances in WSGI for use with
non-blocking libraries like asyncio or Twisted.

Alex

On Wed Oct 29 2014 at 1:45:59 AM Aymeric Augustin <
aymeric.augustin.2...@polytechnique.org> wrote:

> Then the first step is to throw away the ORM.
>
> See my talk at DjangoCon US 2013 for details.
>
> --
> Aymeric.
>
> Le 28 oct. 2014 à 23:36, Marco Paolini  a écrit :
>
> What if we do it with asyncio?
>
> 2014-10-28 22:47 GMT+01:00 Aymeric Augustin <
> aymeric.augus...@polytechnique.org>:
>
>> No, there isn’t.
>>
>> I assume that “including in core” means at least “making usable in
>> combination with WSGI and with the ORM”.
>>
>> Even if we disregard for a minute the fact that WSGI is incompatible with
>> websockets, the ORM is a hard problem, because current solutions involve
>> either (a) threads — not particularly scalable or (b) gevent — not
>> particularly reliable.
>>
>> --
>> Aymeric.
>>
>>
>>
>> On 28 oct. 2014, at 22:06, Luis Masuelli  wrote:
>>
>> Is there any current development involving including websockets in django
>> core?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/50768d16-1d05-489c-8cbf-2091d95ff388%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/7D3898D4-50F7-4ACE-A081-0ACC9D824191%40polytechnique.org
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAEbA68mnak1zdeAjTXM-Qfbz9mm%2B07qhfxZPCJPDfLFqHtcgpg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/EEDD3BFA-B071-4FC4-93C7-0994E073D93B%40polytechnique.org
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 

Re: Websockets... again

2014-10-29 Thread Collin Anderson
Hi Luis,

There is some work on making a WSGI2 that would include support for http/2 
and likely websockets too. That would likely need to happen first or at the 
same time. https://github.com/python-web-sig/wsgi-ng

You could also check out a project called "hendrix" which supports using 
websockets with django.
https://github.com/hangarunderground/hendrix

Collin


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f61df970-139a-4497-81c9-c2f1d8ae367a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Websockets... again

2014-10-29 Thread Aymeric Augustin
Then the first step is to throw away the ORM.

See my talk at DjangoCon US 2013 for details.

-- 
Aymeric.

> Le 28 oct. 2014 à 23:36, Marco Paolini  a écrit :
> 
> What if we do it with asyncio?
> 
> 2014-10-28 22:47 GMT+01:00 Aymeric Augustin 
> :
>> No, there isn’t.
>> 
>> I assume that “including in core” means at least “making usable in 
>> combination with WSGI and with the ORM”.
>> 
>> Even if we disregard for a minute the fact that WSGI is incompatible with 
>> websockets, the ORM is a hard problem, because current solutions involve 
>> either (a) threads — not particularly scalable or (b) gevent — not 
>> particularly reliable.
>> 
>> -- 
>> Aymeric.
>> 
>> 
>> 
>>> On 28 oct. 2014, at 22:06, Luis Masuelli  wrote:
>>> 
>>> Is there any current development involving including websockets in django 
>>> core?
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-developers/50768d16-1d05-489c-8cbf-2091d95ff388%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/7D3898D4-50F7-4ACE-A081-0ACC9D824191%40polytechnique.org.
>> 
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/CAEbA68mnak1zdeAjTXM-Qfbz9mm%2B07qhfxZPCJPDfLFqHtcgpg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/EEDD3BFA-B071-4FC4-93C7-0994E073D93B%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.


Re: Websockets... again

2014-10-29 Thread Florian Apolloner


On Tuesday, October 28, 2014 11:37:15 PM UTC+1, mpaolini wrote:
>
> What if we do it with asyncio?
>

It is 3.4 only, WSGI still has no support for Websockets and the API would 
change drastically… 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/890fc65e-21b5-4104-947d-c16e56b3315f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Websockets... again

2014-10-28 Thread Marco Paolini
What if we do it with asyncio?

2014-10-28 22:47 GMT+01:00 Aymeric Augustin <
aymeric.augus...@polytechnique.org>:

> No, there isn’t.
>
> I assume that “including in core” means at least “making usable in
> combination with WSGI and with the ORM”.
>
> Even if we disregard for a minute the fact that WSGI is incompatible with
> websockets, the ORM is a hard problem, because current solutions involve
> either (a) threads — not particularly scalable or (b) gevent — not
> particularly reliable.
>
> --
> Aymeric.
>
>
>
> On 28 oct. 2014, at 22:06, Luis Masuelli  wrote:
>
> Is there any current development involving including websockets in django
> core?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/50768d16-1d05-489c-8cbf-2091d95ff388%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/7D3898D4-50F7-4ACE-A081-0ACC9D824191%40polytechnique.org
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAEbA68mnak1zdeAjTXM-Qfbz9mm%2B07qhfxZPCJPDfLFqHtcgpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Websockets... again

2014-10-28 Thread Aymeric Augustin
No, there isn’t.

I assume that “including in core” means at least “making usable in combination 
with WSGI and with the ORM”.

Even if we disregard for a minute the fact that WSGI is incompatible with 
websockets, the ORM is a hard problem, because current solutions involve either 
(a) threads — not particularly scalable or (b) gevent — not particularly 
reliable.

-- 
Aymeric.



> On 28 oct. 2014, at 22:06, Luis Masuelli  wrote:
> 
> Is there any current development involving including websockets in django 
> core?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to django-developers@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/django-developers 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/50768d16-1d05-489c-8cbf-2091d95ff388%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7D3898D4-50F7-4ACE-A081-0ACC9D824191%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.


Websockets... again

2014-10-28 Thread Luis Masuelli
Is there any current development involving including websockets in django 
core?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/50768d16-1d05-489c-8cbf-2091d95ff388%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.