goog.labs.result.DeferredAdaptor
Classgoog.labs.result.DeferredAdaptor
> goog.async.Deferred
goog.labs.result.DeferredAdaptor(result)
An adaptor from Result to a Deferred, for use with existing Deferred chains.
result
{!goog.labs.result.Result
}
.addBoth(f, opt_scope)
Inherited from goog.async.Deferred
.
Registers a function as both callback and errback.
f
{!Function
}
opt_scope
{Object
=}
goog.async.Deferred
}
.addCallback(cb, opt_scope)
Inherited from goog.async.Deferred
.
Register a callback function, to be called when a successful result is available.
cb
{!Function
}
opt_scope
{Object
=}
goog.async.Deferred
}
.addCallbacks(cb, eb, opt_scope)
Inherited from goog.async.Deferred
.
Registers a callback function and errback function.
cb
{Function
}
eb
{Function
}
opt_scope
{Object
=}
goog.async.Deferred
}
.addErrback(eb, opt_scope)
Inherited from goog.async.Deferred
.
Register a callback function, to be called if this operation fails.
eb
{!Function
}
opt_scope
{Object
=}
goog.async.Deferred
}
.awaitDeferred(otherDeferred)
Inherited from goog.async.Deferred
.
Makes this Deferred wait for otherDeferred to be called, and its preceding callbacks to be executed, before continuing with the callback sequence. This is equivalent to adding a callback that returns otherDeferred, but doesn't prevent additional callbacks from being added to otherDeferred.
otherDeferred
{!goog.async.Deferred
}
goog.async.Deferred
}
.branch(opt_propagateCancel)
Inherited from goog.async.Deferred
.
Create a branch off this Deferred's callback chain, and return it as a new Deferred. This means that the return value will have the value at the current point in the callback chain, regardless of any further callbacks added to this Deferred. Additional callbacks added to the original Deferred will not affect the value of any branches. All branches at the same stage in the callback chain will receive the same starting value.
opt_propagateCancel
{boolean
=}
goog.async.Deferred
}
.callback(opt_result)
Inherited from goog.async.Deferred
.
Record a successful result for this operation, and send the result to all registered callback functions.
opt_result
{*=}
.cancel(opt_deepCancel)
Inherited from goog.async.Deferred
.
Cancels a deferred that has not yet received a value. If this Deferred is paused waiting for a chained Deferred to fire, the chained Deferred will also be cancelled. If this Deferred was created by calling branch() on a parent Deferred with opt_propagateCancel set to true, the parent may also be cancelled. If opt_deepCancel is set, cancel() will be called on the parent (as well as any other ancestors if the parent is also a branch). If one or more branches were created with opt_propagateCancel set to true, the parent will be cancelled if cancel() is called on all of those branches.
opt_deepCancel
{boolean
=}
.chainDeferred(otherDeferred)
Inherited from goog.async.Deferred
.
Adds another deferred to the end of this deferred's processing chain. Use this when you want otherDeferred to be called at the end of thisDeferred's previous callbacks.
otherDeferred
{!goog.async.Deferred
}
goog.async.Deferred
}
.errback(opt_result)
Inherited from goog.async.Deferred
.
Record that this operation failed with an error, and send the error to all registered errback functions.
opt_result
{*=}
.hasFired()
Inherited from goog.async.Deferred
.
boolean
}
.isError(res)
[protected]Inherited from goog.async.Deferred
.
res
{*}
boolean
}