Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-21 Thread Jeroen van Veen
ndo.com/?page_id=1327 >> >> The first chapter explains the differences between sync/async/threaded. >> >> Fabian >> >> >> From: Jeroen van Veen >> Reply-To: Twisted general discussion >> Date: Tue, 20 Sep 2011 22:10:02 +0200 >> >> T

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-21 Thread Jeroen van Veen
> > Fabian > > > From: Jeroen van Veen > Reply-To: Twisted general discussion > Date: Tue, 20 Sep 2011 22:10:02 +0200 > > To: Twisted general discussion > Subject: Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16 > > Thanks, it would be nice to s

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-21 Thread Jeroen van Veen
2011/9/20 Glyph Lefkowitz > > On Sep 20, 2011, at 3:33 PM, Jeroen van Veen wrote: > > For this websocket cms project im working on, i also run django in a wsgi > container. I wonder if im using it the right way? ( > https://github.com/phrearch/hwios/blob/master/services/web_ui/service.py) > > >

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Glyph Lefkowitz
On Sep 20, 2011, at 3:33 PM, Jeroen van Veen wrote: > For this websocket cms project im working on, i also run django in a wsgi > container. I wonder if im using it the right way? > (https://github.com/phrearch/hwios/blob/master/services/web_ui/service.py) Generally, yes, except for the "Main

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Fabian Rothfuchs
neral discussion Subject: Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16 Thanks, it would be nice to see some more examples of django usage with twisted. I've searched the web a while ago, but could only find a few examples. Especially the part about multi-threading/async wou

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Jeroen van Veen
ssion > Date: Tue, 20 Sep 2011 21:33:39 +0200 > > To: Twisted general discussion > Subject: Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16 > > For this websocket cms project im working on, i also run django in a wsgi > container. I wonder if im using it the right w

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Fabian Rothfuchs
om: Jeroen van Veen Reply-To: Twisted general discussion Date: Tue, 20 Sep 2011 21:33:39 +0200 To: Twisted general discussion Subject: Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16 For this websocket cms project im working on, i also run django in a wsgi container. I wond

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Jeroen van Veen
For this websocket cms project im working on, i also run django in a wsgi container. I wonder if im using it the right way? ( https://github.com/phrearch/hwios/blob/master/services/web_ui/service.py) cheers, Jeroen 2011/9/20 Glyph Lefkowitz > > On Sep 20, 2011, at 1:12 PM, Fabian Rothfuchs wr

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Glyph Lefkowitz
On Sep 20, 2011, at 1:12 PM, Fabian Rothfuchs wrote: > I feel quite happy with that solution till now (planning since 4 hours and > it seems like it could be really working). Great, glad to hear it. Let us know how it goes!___ Twisted-Python mailing l

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Fabian Rothfuchs
>>> >>>If you can afford to make the change, running twisted as a completely >>> separate service in another process, and implementing communication >>> between your Django server and your twisted server via a protocol might >>> simplify things a bit in terms of coordination. >> >> This is exactly

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Glyph Lefkowitz
On Sep 20, 2011, at 12:42 PM, Fabian Rothfuchs wrote: > Hi Daniel, > >> Sorry for any confusion, but I never said anything about using twisted as >> >> a WSGI container for purposes of ensuring thread-safety. I was only >> responding to your question about "how to wrap Django in twisted", and

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Fabian Rothfuchs
Hi Daniel, >Sorry for any confusion, but I never said anything about using twisted as > >a WSGI container for purposes of ensuring thread-safety. I was only >responding to your question about "how to wrap Django in twisted", and >running Django inside twisted's WSGI container is one way to do th

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread L. Daniel Burr
Hi Fabian, On Tue, 20 Sep 2011 06:38:00 -0500, Fabian Rothfuchs wrote: > As Twisted points out not to be thread-safe, why would it be in WSGI? > > Due to the sensibility of the project I cannot afford things to go wrong > because of not synchronized threads or other pitfalls, so I actually >

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-20 Thread Fabian Rothfuchs
As Twisted points out not to be thread-safe, why would it be in WSGI? Due to the sensibility of the project I cannot afford things to go wrong because of not synchronized threads or other pitfalls, so I actually decided to to the asynchronous way, and this bites with WSGI. Fabian On 9/19/11 10:

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread exarkun
On 08:05 pm, fabian.rothfu...@googlemail.com wrote: So JP, Having the reactor running in a first thread and *all* the rest in a second one is alright, if the second one calls the reactor via callFromThread() ? Yes, that's fine. (I think Glyph got you pointed in the right direction, I didn't

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread L. Daniel Burr
Hi, On Mon, 19 Sep 2011 15:05:07 -0500, Fabian Rothfuchs wrote: > So JP, > Having the reactor running in a first thread and *all* the rest in a > second one > is alright, if the second one calls the reactor via callFromThread() ? > > Elsewise, I need to find out how to wrap Twisted around Djan

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread Fabian Rothfuchs
So JP, Having the reactor running in a first thread and *all* the rest in a second one is alright, if the second one calls the reactor via callFromThread() ? Elsewise, I need to find out how to wrap Twisted around Django… hum… Fabian On 9/19/11 9:53 PM, "exar...@twistedmatrix.com" wrote: >

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread exarkun
On 07:02 pm, fabian.rothfu...@googlemail.com wrote: Well no, not from multiple threads. I have only two threads ­ one main thread, which is the Django framework, and one detached thread for the reactor, as the reactor itself would be blocking Django. All Adapters are in Django, and are reachin

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread Glyph Lefkowitz
On Sep 19, 2011, at 3:40 PM, Fabian Rothfuchs wrote: > That’s a tremendous advice! > Indeed I was directly calling connectTCP() - I changed it to do like > > reactor.callFromThread(reactor.connectTCP, host, port, factory, timeout=5) > > Thanks! No problem! I'm glad I caught this befo

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread Fabian Rothfuchs
: Twisted general discussion Subject: Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16 On Sep 19, 2011, at 3:02 PM, Fabian Rothfuchs wrote: > Well no, not from multiple threads. > I have only two threads ­ one main thread, which is the Django framework, and > one detached

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread Glyph Lefkowitz
On Sep 19, 2011, at 3:02 PM, Fabian Rothfuchs wrote: > Well no, not from multiple threads. > I have only two threads – one main thread, which is the Django framework, and > one detached > thread for the reactor, as the reactor itself would be blocking Django. > > All Adapters are in Django, an

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread Fabian Rothfuchs
threading themselves. Is this 'allowed' ? Fabian From: Glyph Lefkowitz Reply-To: Twisted general discussion Date: Mon, 19 Sep 2011 14:16:56 -0400 To: Twisted general discussion Subject: Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16 On Sep 19, 2011, at 2:03 PM, Fabian

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread Glyph Lefkowitz
On Sep 19, 2011, at 2:03 PM, Fabian Rothfuchs wrote: > The second important part was the wakeUp() call, which apparently triggers > the reactor > To end all blocking tasks. For the most part, you have got the right idea now, but this is a BIG flashing red light for me. wakeUp() shouldn't actua

Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

2011-09-19 Thread Fabian Rothfuchs
>One thing you can do is make a small initial startup method that >you supply to reactor.callLater with a delay of 0, that does the loop on >the connectTCP()'s. It will start up your initial set of connections. Thanks John, this was *really* helpful! I now did the following: 1. On Startup, the ap