[Twisted-Python] Recovering PB references on broken connection?

Jp Calderone exarkun at intarweb.us
Mon Dec 29 11:52:21 EST 2003

On Mon, Dec 22, 2003 at 07:23:45PM -0500, David Bolen wrote:
> I've been experimenting with the perspective broker in Twisted 1.1.0
> and am wondering?  Is there any graceful way to reconnect and continue
> to use PB references if you temporarily lose a connection due to a
> network outage?

  PB references are managed by the connection's Broker object, which is
created anew in the factory's buildProtocol method, and the object/reference
cache of which is cleared when connections are lost.

  Having references which can withstand disconnects should be doable
relatively easily - all you need to do is make sure the same Broker objects
get used for all subsequent reconnections.  This may be a little tricky,
since you need to differentiate between new connections and reconnections
(which you can't do easily with PB, because you'll already have a Broker),
but should be entirely possible.

  I'm not sure if there is any reason, other than trickiness factor, that
this isn't implemented directly in twisted.spread.  Perhaps there is a
hidden issue I am unaware of, or maybe it is simply that no one has wanted
it badly enough to write it :)

  Hope this helps,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031229/44d64222/attachment.pgp 

More information about the Twisted-Python mailing list