Skip to content
Browse files

Remove references to promise

  • Loading branch information...
1 parent d151865 commit 75057c4600cb2d0d67e8d42cc55ed8c6484d4f50 Christian Johansen committed Feb 8, 2012
Showing with 10 additions and 12 deletions.
  1. +6 −6 site/docs/args.html
  2. +3 −3 site/docs/client/client.html
  3. +1 −1 site/docs/client/session.html
  4. +0 −2 site/docs/test/stack-filter.html
View
12 site/docs/args.html
@@ -337,22 +337,22 @@ <h3 id="async-validators">Asynchronous validators</h3>
Promises are used to facilitate asynchronous validators. Here's an example
of a validator that checks if a file is larger than 1MB.
</p>
- <pre><code>var busterPromise = require("buster-promise");
+ <pre><code>var when = require("when");
opt.addValidator(function () {
var self = this;
- var promise = busterPromise.create();
+ var deferred = when.defer();
fs.stat(this.value(), function (err, stat) {
if (err) {
- promise.reject("Unknown error: " + err);
+ deferred.resolver.reject("Unknown error: " + err);
}
if (stat.size > 1024) {
- promise.reject(self.value() + " (" + self.signature + ") was larger than 1MB");
+ deferred.resolver.reject(self.value() + " (" + self.signature + ") was larger than 1MB");
} else {
- promise.resolve();
+ deferred.resolver.resolve();
}
});
- return promise;
+ return deferred.promise;
});</code></pre>
<p>
Given <kbd>--myopt /path/to/file</kbd> and the file is larger than 1MB,
View
6 site/docs/client/client.html
@@ -19,7 +19,7 @@ <h3 id="create" data-title="+create(port, host, path);+"><code>var client = bust
running <a href="/buster-capture-server/">buster-capture-server</a>.
</p>
<h3 id="createSession" data-title="+createSession(config);+">
- <code>var <a href="/buster-promise/">promise</a> = client.createSession(<a href="#options">options</a>);</code>
+ <code>var promise = client.createSession(<a href="#options">options</a>);</code>
</h3>
<p>
Creates and runs a new session on the server. The provided resource set
@@ -47,14 +47,14 @@ <h3 id="createSession" data-title="+createSession(config);+">
// Use session
});</code></pre>
<h3 id="getCachedResources" data-title="+getCachedResources();+">
- <code>var <a href="/buster-promise/">promise</a> = client.getCachedResources();</code>
+ <code>var promise = client.getCachedResources();</code>
</h3>
<p>
Fetches a list of resources cached on the server. These can optionally be
reused if their content has not changed. The returned promise is resolved
with a <a href="#cachedResources"><code>cachedResources</code></a> object when ready.
</p>
- <h3 id="useCachedResources" data-title="+useCachedResources(config);+"><code>var <a href="/buster-promise/">promise</a> = client.useCachedResources(<a href="/buster-client/session-config/#formatted-session-config">config</a>);</code></h3>
+ <h3 id="useCachedResources" data-title="+useCachedResources(config);+"><code>var promise = client.useCachedResources(<a href="/buster-client/session-config/#formatted-session-config">config</a>);</code></h3>
<p>
Tweak the session configuration to use cached resources where possible.
</p>
View
2 site/docs/client/session.html
@@ -33,7 +33,7 @@ <h3 id="emit"><code>emit(event, data);</code></h3>
<a href="/buster-multicast/#on"><code>buster.multicast.emit</code></a> for
details.
</p>
- <h3 id="close" data-title="+close();+"><code>var <a href="/buster-promise/">promise</a> = session.close();</code></h3>
+ <h3 id="close" data-title="+close();+"><code>var promise = session.close();</code></h3>
<p>
Close session. Sends a HTTP request to the server. Returns a promise that
will resolve once the session has been removed from the server.
View
2 site/docs/test/stack-filter.html
@@ -41,8 +41,6 @@ <h3 id="stackFilter" data-title="+stackFilter(stack[, cwd])+">
'at asyncFunction (/home/christian/buster/node_modules/buster-test/lib/buster-test/runner.js:79:21)' +
'at Object.runTestFunction (/home/christian/buster/node_modules/buster-test/lib/buster-test/runner.js:312:26)' +
'at /home/christian/buster/node_modules/buster-core/lib/buster-core.js:45:31' +
- 'at runOne (/home/christian/buster/node_modules/buster-promise/lib/buster-promise.js:89:35)' +
- 'at Array.0 (/home/christian/buster/node_modules/buster-promise/lib/buster-promise.js:75:47)' +
'at EventEmitter._tickCallback (node.js:108:26)';</code></pre>
<p><code>stackFilter</code> would reduce it like so:</p>
<pre><code>var lines = buster.stackFilter(stack, "/home/christian/buster");

0 comments on commit 75057c4

Please sign in to comment.
Something went wrong with that request. Please try again.