Browse Source

Add documentation for promise.emitSuccess and emitError

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
fdc136df69
  1. 21
      doc/api.html
  2. 10
      doc/api.txt
  3. 26
      doc/node.1

21
doc/api.html

@ -280,6 +280,25 @@ Adds a listener for the <tt>"error"</tt> event. Returns the same promise object.
</p>
</dd>
<dt class="hdlist1">
<tt>promise.emitSuccess(arg1, arg2, &#8230;)</tt>
</dt>
<dd>
<p>
If you created the promise (by doing <tt>new node.Promise()</tt>) then call
<tt>emitSuccess</tt> to emit the <tt>"success"</tt> event with the given arguments.
</p>
<div class="paragraph"><p>(<tt>promise.emit("success", arg1, arg2, &#8230;)</tt> should also work, but doesn&#8217;t at
the moment due to a bug; use <tt>emitSuccess</tt> instead.)</p></div>
</dd>
<dt class="hdlist1">
<tt>promise.emitError(arg1, arg2, &#8230;)</tt>
</dt>
<dd>
<p>
Emits the <tt>"error"</tt> event.
</p>
</dd>
<dt class="hdlist1">
<tt>promise.wait()</tt>
</dt>
<dd>
@ -1861,7 +1880,7 @@ init (Handle&lt;Object&gt; target)
<div id="footer">
<div id="footer-text">
Version 0.1.10<br />
Last updated 2009-09-13 18:25:27 CEST
Last updated 2009-09-15 15:23:59 CEST
</div>
</div>
</body>

10
doc/api.txt

@ -165,6 +165,16 @@ Adds a listener for the +"success"+ event. Returns the same promise object.
+promise.addErrback(listener)+ ::
Adds a listener for the +"error"+ event. Returns the same promise object.
+promise.emitSuccess(arg1, arg2, ...)+ ::
If you created the promise (by doing +new node.Promise()+) then call
+emitSuccess+ to emit the +"success"+ event with the given arguments.
+
(+promise.emit("success", arg1, arg2, ...)+ should also work, but doesn't at
the moment due to a bug; use +emitSuccess+ instead.)
+promise.emitError(arg1, arg2, ...)+ ::
Emits the +"error"+ event.
+promise.wait()+ ::
Blocks futher execution until the promise emits a success or error event.
Events setup before the call to +promise.wait()+ was made may still be

26
doc/node.1

@ -1,11 +1,11 @@
.\" Title: node
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\" Date: 09/13/2009
.\" Date: 09/15/2009
.\" Manual:
.\" Source:
.\"
.TH "NODE" "1" "09/13/2009" "" ""
.TH "NODE" "1" "09/15/2009" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
@ -236,6 +236,28 @@ Adds a listener for the
event\. Returns the same promise object\.
.RE
.PP
promise\.emitSuccess(arg1, arg2, \&...)
.RS 4
If you created the promise (by doing
new node\.Promise()) then call
emitSuccess
to emit the
"success"
event with the given arguments\.
.sp
(promise\.emit("success", arg1, arg2, \&...)
should also work, but doesn\(cqt at the moment due to a bug; use
emitSuccess
instead\.)
.RE
.PP
promise\.emitError(arg1, arg2, \&...)
.RS 4
Emits the
"error"
event\.
.RE
.PP
promise\.wait()
.RS 4
Blocks futher execution until the promise emits a success or error event\. Events setup before the call to

Loading…
Cancel
Save