Represents the (future) results of executing a query.
Returns an array containing all the depths that the given entity appeared in the traversal.
an entity
Returns a selection on the resultant graph that contains all the entities that were included in this ResultSet at the given traversal depth.
Returns the graph that will contain the results of this query, when it is complete. Note, since queries are executed asynchronously, the contents of the graph will not be complete until the ResultSet has completed.
Returns the maximum depth that the given entity appeared in the traversal, or undefined if the given entity did not appear in the traversal. If this method is called with zero arguments, it returns the maximum depth of the entire graph.
an entity
Returns the minimum depth that the given entity appeared in the traversal, or undefined if the given entity did not appear in the traversal. If this method is called with zero arguments, it returns the minimum depth of the entire graph, which is either zero or undefined, if the ResultSet is emtpy.
an entity
Register a function that will be called when this ResultSet produces the first result.
Register a function that will be called each time this ResultSet produces a result.
* Return the query used to construct this ResultSet
Return a selection that contains the roots (starting points) of this ResultSet.
Binds a this argument to the future which will be passed to listeners when this Future is called.
returns this future
Cancels this future, causing it to go into the Future.CANCELLED state.
the optional value that will be passed to this futures cancel listeners
returns this Future
Fails this future, with the given reason. Users should never call this method directly.
returns this future
Fulfills this future which marks the future as being successfully completed.
an optional value that was created by the future.
Register a function to be called if this Future completes. The function will be called with the value of the future as the argument.
Note this API does not currently support removing the listener.
this future
Register a function to be called if this Future fails.
Note this API does not currently support removing the listener.
this future
Register a function to be called as progress events occur on this Future. The function will be called with the value of the progress as the argument.
Note this API does not currently support removing the listener.
this future
Progresses this future, with the given arguments. Users should never call this method directly.
optional value that will be passed this future's progress listeners
returns this future
Registers a set of listeners that are called as this future progresses. And returns a new future that is fulfilled by the return value of the oncomplete handler. In this way, Futures can be chained.
the function to call when this Future is complete.
the function to call if this Future encounters an error. This will only be called one or zero times.
the function to call as this Future progresses. This is not guaranteed to be called.
thinkmap.async.later(function() { return 5; },2000)
.then(function(x) { return v + 2; })
.then(function(v) { alert(v); });
Add a listener to this EventSource
the name of the event to listen for
the callback to add
this eventsource
Dispatch an event from this EventSource, supplying arguments to the listeners via an Array, rather than var-args.
the name of the event to dispatch
this EventSource
Dispatch an event from this EventSource
the name of the event to dispatch
optional arguments sent to the event listeners
this EventSource
Fire an event from this EventSource
the name of the event to dispatch
optional arguments sent to the event listeners
this EventSource
Remove a listener from this EventSource
the name of the event to remove the listener for
the callback to remove
this eventsource
Add a listener to this EventSource
the name of the event to listen for
the callback
this eventsource
Add a listener to this EventSource, which will be called at most once and will be removed the first time the given event fires.
the name of the event to listen for
the callback to add
this eventsource
Remove a listener from this EventSource
the name of the event to remove the listener for
the callback to remove
this eventsource
fired when this future completes. The arguments to this event are the arguments used to fulfill (complete) this future
fired when this future is cancelled. The arguments to this event are the arguments passed to the cancel method of this future
fired when this future encounters an error. The arguments to this event are the error which caused this future from being unable to complete.
fired when this future has been notified of progress. The arguments to this event are the arguments passed to this futures progress method.