Part of twisted.pb.referenceable View Source View In Hierarchy
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 526 | Method | checkToken | Check to see if the given token is acceptable (does it conform to |
| 535 | Method | receiveChild | 'childobject' is being handed to this unslicer. It may be a |
| 548 | Method | receiveClose | Called when the Close token is received. Returns a tuple of |
| 555 | Method | ackGift | Undocumented |
| 564 | Method | describe | Return a short string describing where in the object tree this |
Inherited from LeafUnslicer:
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 537 | Method | doOpen | opentype is a tuple. Return None if more index tokens are |
Inherited from BaseUnslicer (via LeafUnslicer):
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 419 | Method | __init__ | Undocumented |
| 425 | Method | setConstraint | Add a constraint for this unslicer. The unslicer will enforce |
| 428 | Method | start | Called to initialize the new slice. The 'count' argument is the |
| 434 | Method | openerCheckToken | 'typebyte' is the type of an incoming index token. 'size' is the |
| 437 | Method | open | Return an IUnslicer object based upon the 'opentype' tuple. |
| 471 | Method | reportViolation | You have received an error instead of a child object. If you wish |
| 477 | Method | finish | Called when the unslicer is popped off the stack. This is called |
| 481 | Method | setObject | To pass references to previously-sent objects, the [OPEN, |
| 494 | Method | getObject | 'None' means 'ask our parent instead'. |
| 499 | Method | explode | If something goes wrong in a Deferred callback, it may be too |
(obj, None): the object is complete and ready to go
(d1, None): the object cannot be referenced yet, probably
because it is an immutable container, and one of its
children cannot be referenced yet. The deferred will
fire by the time the cycle has been fully deserialized,
with the object as its argument.
(obj, d2): the object can be referenced, but it is not yet
complete, probably because some component of it is
'slow' (see below). The Deferred will fire (with an
argument of None) when the object is ready to be used.
It is not guaranteed to fire by the time the enclosing
top-level object has finished deserializing.
(d1, d2): the object cannot yet be referenced, and even if it could
be, it would not yet be ready for use. Any potential users
should wait until both deferreds fire before using it.
The first deferred (d1) is guaranteed to fire before the top-most enclosing object (a CallUnslicer, for PB methods) is closed. (if it does not fire, that indicates a broken cycle). It is present to handle cycles that include immutable containers, like tuples. Mutable containers *must* return a reference to an object (even if it is not yet ready to be used, because it contains placeholders to tuples that have not yet been created), otherwise those cycles cannot be broken and the object graph will not reconstructable.
The second (d2) has no such guarantees about when it will fire. It indicates a dependence upon 'slow' external events. The first use case for such 'slow' objects is a globally-referenceable object which requires a new Broker connection before it can be used, so the Deferred will not fire until a TCP connection has been established and the first stages of PB negotiation have been completed.
If necessary, unbanana.setObject should be called, then the Deferred created in start() should be fired with the new object.