hi there, folks:
I'd really like to release 0.7.0 but I would like it to be at least a
little bit tested before I do so. Could those of you with CVS trees check
everything out and see if it performs as advertised? Deeper bugs than
that will have to wait for the next release, but I'd at least like to know
if it works for someone other than me.
______ __ __ _____ _ _
| ____ | \_/ |_____] |_____|
|_____| |_____ | | | |
@ t w i s t e d m a t r i x . c o m
I have a twisted TCP server to listens to client, processes requests, do
mysql database operations if needed (using adbapi Connection pool) and
return the result. Before deploying this in production, I want to know
right way to configure the server.
Since twisted is single threaded, how can I leverage multiple cores of my
production machine (which has 6 cores and 16 GB RAM) ?
One approach that I thought of was to start multiple instances of twisted
server on different ports. This would help in using the other cores as
well. What do you guys suggest ?
Some of you may have heard rumors of some work in progress on a
replacement for Twisted's IConsumer/IProducer interfaces.
Tubes have been largely Glyph's effort (though a lot of people have
contributed in one way or another). And a large effort it's been.
Development is proceeding in a Twisted branch and comes to over three
thousand lines of additions so far.
Given the large size of the implementation and the long time that this
effort has been underway (I remember the Twisted meetup at the Rackspace
offices that *I* attended when I was visiting SF... a year and a half
ago... at which point tubes wasn't exactly a brand new project) I'd like
to re-raise the idea that the best next step for the project is to see
some distribution in its *current* state.
Specifically, I think it would be beneficial to set up a tubes project
on Github under the Twisted organization and try for a release in the
very near future.
I think this has several advantages over the status quo:
1) As an independent project, tubes will attract more attention than it
presently gets as a relatively unknown ticket & branch of Twisted.
2) As a separate Python package, the logistics of actually using tubes
are simpler (just consider how you might declare a dependency on a
branch of Twisted - keeping in mind you may want to use tubes in a
project that already depends on some version of Twisted). It may not
make sense to say that it is the same quality as Twisted proper right
off the bat (on the other hand, it may well - I suspect tubes in its
current form actually is a lot higher quality than large sections of
Twisted) but that doesn't mean people (not to mention the tubes project)
can't benefit from being able to experiment with it.
3) Decoupling tubes from Twisted frees tubes from certain of Twisted's
policies which are more challenging to follow for the kind of non-
trivial, brand new code base that tubes is. Technically we could just
say that these policies don't apply to a tubes package *in* Twisted but
this kind of subtle distinction is often lost on users (ie application
a) Twisted's compatibility policy need not apply. It could either be
sped up or abandoned more thoroughly. I'm generally a fan of being
backwards compatible even when you have few users because it actually
makes development easier, but loosening the policy to say things might
break if it's just really inconvenient to keep them working (whereas
Twisted goes to the inconvenience to keep them working) seems
b) tubes can undergo a faster release cycle to benefit more from user
4) At this point, a normal review of the tubes branch is going to be a
problem. We do not have good tools or mechanisms for dealing with
branches this large. The code in the current tubes branch can just
become master of a new project. Development going forward from this
point should continue to follow the feature-branch, small-changes, pre-
commit-peer-review process. But those 3k lines are written already.
Short of an extremely expensive effort to break the work up into
smaller, self-contained pieces there's simply never going to be a *good*
review in the typical style.
Additionally, it may turn out that tubes can remain independent
indefinitely. Someday perhaps Twisted would come to depend on it to
allow the various protocols and applications implemented in Twisted to
benefit from the superior abstractions it provides. Or maybe once it
has undergone a few iterations it will make sense to bring it back to
Twisted. I don't think this needs to be decided now.
There are downsides, of course. All of the boring maintenance involved
with having a separate project - setting up CI, actually doing the
releases, etc. Perhaps we could find some volunteers to help out with
these tasks, though, in exchange for getting some great code out there?
I'm curious what the folks out there who develop applications using
Twisted would find to be the easiest path forward. I'm also curious to
hear what Glyph thinks about all this. ;)
A short while ago Twisted's trac installation was changed to reject new tickets
from anyone except a special white listed group.
As of yesterday I have reverted this change, (and turned the spam filter back
on). If you experience any issues trying to post, or notice and spam, please
feel free to reach out to me.
I've been trying to address ticket 7274
To do this, I am trying to understand the PB protocol. While I found a spec
for banana in twisted-daniel/docs/core/specifications/banana.rst, I have
not found anything similar for pb. I've been piecing it together by writing
little test scripts, but it is slow going. In particular, it is very
difficult to understand the meaning of verbs like "cook" and "preserve" and
nouns like "persistent store" without some global picture of what's going
1. Is there some kind of narrative documentation on how pb works under the
2. Is there a specification for the pb dialect of banana?
3. Is there anyone else out there interested enough in pb to want to work
with me to figure things out and produce documentation if there isn't any
When size of terminal window of ssh client is changed, then twisted ssh
server throws an exception:
exceptions.AttributeError: TerminalSession instance has no attribute
`manhole_ssh.TerminalSession` doesn't implement this method, but according
to ISession interface it should.
Is this a bug?
I use insults to create some curses-like ui and I need widgets to be
redrawn when the size of window is changed.
Consider the following (blocking) decorator, which runs a function in a transaction:
def decorated(self, *args, **kwargs):
conn = self.engine.connect()
txn = conn.begin()
result = f(self, conn, *args, **kwargs)
Where I to translate this logic verbatim to @inlineCallbacks, I get:
def decorated(self, *args, **kwargs):
conn = yield self.engine.connect()
txn = yield conn.begin()
result = yield f(self, conn, *args, **kwargs)
However, there’s a bug here! In the except clause: there’s an (implicit) current exception, to be re-raised by the bare raise statement. Unfortunately, when doing yield txn.rollback(), that conveniently eats said exception.
Of course, there’s a fairly simple workaround involving catching BaseException and capturing the exception instance explicitly.
I’m wondering if this is just a leaky abstraction, or if I should report it as a bug in @inlineCallbacks?
Before I re-invent the wheel, is there a twisted library that will let me:
1. Fire up child worker processes
2. That log to a logObserver coming out in the parent
3. Manage the whole lot as a .tac file
Note I *don't* need deferToProcess or similar in this situation. I just
need to fire up N processes but have them managed by and logging "to" a
single parent controlled by twistd.
(FWIW, they're stateless workers that pull from a work queue).