Skip to content

Commit

Permalink
Travis build 599 committed dist/ and doc/
Browse files Browse the repository at this point in the history
  • Loading branch information
falcor-build committed Oct 17, 2017
1 parent 184f365 commit 37eb4dd
Show file tree
Hide file tree
Showing 4 changed files with 319 additions and 39 deletions.
115 changes: 115 additions & 0 deletions doc/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,121 @@ <h3 class="subsection-title">Methods</h3>



<section class="method-section">



<h4 class="name section-header function-name" id="findPartialIntersections"><span class="type-signature"></span>findPartialIntersections<span class="signature">()</span><span class="type-signature return-signature"></span></h4>





<div class="description">
<p>Recursive function to calculate intersection and complement paths in 2 given
pathsets at a given depth
Parameters:</p>
<ul>
<li><code>requestedPath</code>: full requested path (can include ranges)</li>
<li><code>optimizedPath</code>: corresponding optimized path (can include ranges)</li>
<li><code>currentTree</code>: path map for in-flight request, against which to dedupe</li>
<li><code>depth</code>: index of optimized path that we are trying to match with <code>currentTree</code></li>
<li><code>rCurrentPath</code>: current accumulated requested path by previous recursive<pre class="prettyprint source"><code> iterations. Could also have been pre-initialized as stated
above.
This path cannot contain ranges, instead contains a key
from the range, representing one of the individual paths
in `requestedPath` pathset</code></pre></li>
<li><code>oCurrentPath</code>: corresponding accumulated optimized path, to be matched<pre class="prettyprint source"><code> with `currentTree`. Could have been pre-initialized.
Cannot contain ranges, instead contains a key from the
range at given `depth` in `optimizedPath`</code></pre></li>
<li><p><code>depthDiff</code>: difference in length between <code>requestedPath</code> and <code>optimizedPath</code></p>
<p>Example scenario:</p>
<ul>
<li>requestedPath: ['lolomo', 0, 0, 'tags', { from: 0, to: 2 }]</li>
<li>optimizedPath: ['videosById', 11, 'tags', { from: 0, to: 2 }]</li>
<li>currentTree: { videosById: 11: { tags: { 0: null, 1: null }}}
// since requested path is longer, optimized path index starts from depth 0
// and accumulated requested path starts pre-initialized (rCurrentPath)</li>
<li>depth: 0</li>
<li>rCurrentPath: ['lolomo']</li>
<li>oCurrentPath: []</li>
<li>depthDiff: 1</li>
</ul>
</li>
</ul>
</div>















<dl class="details">


























<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<a href="request_complement.js.html">request/complement.js</a>, <a href="request_complement.js.html#line127">line 127</a>
</dd>







</dl>















</section>


<section class="method-section">


Expand Down
16 changes: 9 additions & 7 deletions doc/request_GetRequestV2.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,16 @@ <h2>
/**
* Attempts to add paths to the outgoing request. If there are added
* paths then the request callback will be added to the callback list.
* Handles adding partial paths as well
*
* @returns {Array} - the remaining paths in the request.
* @returns {Array} - whether new requested paths were inserted in this
* request, the remaining paths that could not be added,
* and disposable for the inserted requested paths.
*/
add: function(requested, optimized, callback) {
add: function(requested, optimized, depthDifferences, callback) {
// uses the length tree complement calculator.
var self = this;
var complementTuple = complement(requested, optimized, self._pathMap);
var complementTuple = complement(requested, optimized, depthDifferences, self._pathMap);
var optimizedComplement;
var requestedComplement;

Expand All @@ -154,10 +157,9 @@ <h2>
var inserted = false;
var disposable = false;

// If the out paths is less than the passed in paths, then there
// has been an intersection and the complement has been returned.
// Therefore, this can be deduped across requests.
if (optimizedComplement.length &lt; optimized.length) {
// If we found an intersection, then just add new callback
// as one of the dependents of that request
if (complementTuple &amp;&amp; complementTuple[0].length) {
inserted = true;
var idx = self._callbacks.length;
self._callbacks[idx] = callback;
Expand Down
4 changes: 2 additions & 2 deletions doc/request_RequestQueueV2.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h2>
* @param {Array} optimizedPaths -
* @param {Function} cb -
*/
get: function(requestedPaths, optimizedPaths, cb) {
get: function(requestedPaths, optimizedPaths, depthDifferences, cb) {
var self = this;
var disposables = [];
var count = 0;
Expand All @@ -81,7 +81,7 @@ <h2>
// if possible.
if (request.sent) {
var results = request.add(
rRemainingPaths, oRemainingPaths, refCountCallback);
rRemainingPaths, oRemainingPaths, depthDifferences, refCountCallback);

// Checks to see if the results were successfully inserted
// into the outgoing results. Then our paths will be reduced
Expand Down
Loading

0 comments on commit 37eb4dd

Please sign in to comment.