[Twisted-Python] Twisted 13.2.0pre1 Announcement

2013-10-21 Thread HawkOwl
Hello everyone! I bring news of a Twisted pre-release - 13.2.0pre1, to be exact! This will be followed by the full release of 13.2.0 in the coming weeks. The highlights of this release are: * Twisted now includes a HostnameEndpoint implementation which uses IPv4 and IPv6 in parallel, s

Re: [Twisted-Python] Clean pb solution for two-way object sync?

2013-10-21 Thread Daniel Sank
> Here's my game that uses PB: https://github.com/dripton/Slugathon This has been useful. I am learning from it and my own experimentation. > One piece of advice: do the network code first and always exercise it, even > when playing on a single computer. Every time I've written a single-machine

Re: [Twisted-Python] serial communication - getting started

2013-10-21 Thread Robert Voigtländer
This works. Thanks a lot. So sending and receiving works .. with low CPU usage. I need to dig into twisted As a Python starter I want something like serial.send usabel in the main loop and serial.receive to work in the background and only trigger something once data has been received. Obvious

Re: [Twisted-Python] Flow-control for Pipes / Unix Domains Sockets?

2013-10-21 Thread Itamar Turner-Trauring
On 10/21/2013 04:48 PM, Tobias Oberstein wrote: Flow-control for Pipes / Unix Domains Sockets? Hi, with TCP (either remote or loopback) I can have flow-control using the producer-consumer machinery that Twisted provides. Is that (flow-control / producer-consumer) also available (and practica

Re: [Twisted-Python] Flow-control for Pipes / Unix Domains Sockets?

2013-10-21 Thread Tobias Oberstein
fwiw, I have been trying to get find a conclusive answer to the subquestion: Do Unix domain sockets (either stream or dgram) support flow-control? The nearest I could find is http://stackoverflow.com/questions/1478975/unix-domain-socket-is-there-such-a-thing-as-a-busy-signal/1479022 but the comme

Re: [Twisted-Python] Defer until a server is ready?

2013-10-21 Thread Eric P. Mangold
On Mon, Oct 21, 2013 at 03:08:56PM -0700, Russell E. Owen wrote: > For unit testing and other reasons I would like to launch a server in a > subprocess, then wait until it is available before running some code > that uses it. Is there a standard paradigm for this, e.g. poll until a > connection

[Twisted-Python] Defer until a server is ready?

2013-10-21 Thread Russell E. Owen
For unit testing and other reasons I would like to launch a server in a subprocess, then wait until it is available before running some code that uses it. Is there a standard paradigm for this, e.g. poll until a connection is accepted, or have the server emit some kind of "ready" signal (such a

Re: [Twisted-Python] Flow-control for Pipes / Unix Domains Sockets?

2013-10-21 Thread David Stainton
Hi, I don't know the answer to your question... I've been thinking about flow control lately. I recently wrote a little working prototype VPN in Twisted using IPushProducer and IConsumer interfaces but I have not yet implemented flow control : Here we can see how I proxy between TUN and UDP usin

Re: [Twisted-Python] Twisted as a full solution for web hosting [WSGI + other]

2013-10-21 Thread Glyph
On Oct 21, 2013, at 1:16 PM, Phil Mayers wrote: > Does the Twisted wsgi runner have support for process rather than threading > models to avoid the gil? Because if so I should take a look at it... Nope. It ought to though: . Any interest in tacklin

[Twisted-Python] Flow-control for Pipes / Unix Domains Sockets?

2013-10-21 Thread Tobias Oberstein
Hi, with TCP (either remote or loopback) I can have flow-control using the producer-consumer machinery that Twisted provides. Is that (flow-control / producer-consumer) also available (and practically usable/recommended) with: a) Unix Domain sockets b) Pipes (spawnProcess) ? Thanks! /Tobias

Re: [Twisted-Python] serial communication - getting started

2013-10-21 Thread exarkun
On 07:42 pm, ltaylor.vo...@gmail.com wrote: On Oct 21, 2013, at 6:57 AM, Robert Voigtländer wrote: Thanks for the fast reply. I don't yet understand your answer. I may have to dig more into Python. On 21 October 2013 13:45, Itamar Turner-Trauring wrote: 3. A reasonable place for the w

Re: [Twisted-Python] Twisted as a full solution for web hosting [WSGI + other]

2013-10-21 Thread Phil Mayers
Does the Twisted wsgi runner have support for process rather than threading models to avoid the gil? Because if so I should take a look at it... -- Sent from my phone with, please excuse brevity and typos___ Twisted-Python mailing list Twisted-Python@tw

Re: [Twisted-Python] serial communication - getting started

2013-10-21 Thread Lucas Taylor
On Oct 21, 2013, at 6:57 AM, Robert Voigtländer wrote: > Thanks for the fast reply. > I don't yet understand your answer. I may have to dig more into Python. > > On 21 October 2013 13:45, Itamar Turner-Trauring wrote: > > 3. A reasonable place for the write() might be in your Protocol's >

Re: [Twisted-Python] Twisted as a full solution for web hosting [WSGI + other]

2013-10-21 Thread Glyph
On Oct 20, 2013, at 2:21 AM, Orestis Markou wrote: > Hello, > > Short form of the question: > > Are people using Twisted to host WSGI applications AND serve static files AND > replace celery/redis/other? I'm not personally using it as a WSGI host, but otherwise, yes, a full-stack applicatio

Re: [Twisted-Python] serial communication - getting started

2013-10-21 Thread Robert Voigtländer
Thanks a lot! I'll dig throught the code. On 21 October 2013 14:20, Tobias Oberstein wrote: > Robert, > > ** ** > > as Itamar said: don't use thread -- you likely don't need them in your > scenario. > > ** ** > > shameless self-plug: > > ** ** > > http://www.youtube.com/watch?v=va7j8

Re: [Twisted-Python] serial communication - getting started

2013-10-21 Thread Tobias Oberstein
Robert, as Itamar said: don't use thread -- you likely don't need them in your scenario. shameless self-plug: http://www.youtube.com/watch?v=va7j86thW5M https://github.com/tavendo/AutobahnPython/tree/master/examples/wamp/serial2ws The example includes both Arduino code and Twisted/Autobahn code

Re: [Twisted-Python] serial communication - getting started

2013-10-21 Thread Robert Voigtländer
Thanks for the fast reply. I don't yet understand your answer. I may have to dig more into Python. On 21 October 2013 13:45, Itamar Turner-Trauring wrote: > On 10/21/2013 07:35 AM, Robert Voigtländer wrote: > > def SerialInit(): > ... > > reactor.run() > > > thread.start_new_thread(Se

Re: [Twisted-Python] serial communication - getting started

2013-10-21 Thread Itamar Turner-Trauring
On 10/21/2013 07:35 AM, Robert Voigtländer wrote: def SerialInit(): ... reactor.run() thread.start_new_thread(SerialInit()) if __name__ == '__main__': print("-") s.write('123456789') #s.write("\n") 1. Twisted is not thread-safe, so you can't call methods on the protocol f

[Twisted-Python] serial communication - getting started

2013-10-21 Thread Robert Voigtländer
Hi, I am new to Python. Trying to figure out how to use the serial port I started with pyserial. Works - but the CPU usage on my Raspberry Pi is at about 30% just for reading the port. Before I started to optimize the code it was even 90+%. So I tried twisted - and boom down to 3-4%. Even though