From fdc136df690d11a9b5b65ac58e9c1f420b24c274 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 15 Sep 2009 15:25:06 +0200 Subject: [PATCH] Add documentation for promise.emitSuccess and emitError --- doc/api.html | 21 ++++++++++++++++++++- doc/api.txt | 10 ++++++++++ doc/node.1 | 26 ++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/doc/api.html b/doc/api.html index dcae34f3ad..6e078bf049 100644 --- a/doc/api.html +++ b/doc/api.html @@ -280,6 +280,25 @@ 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()
@@ -1861,7 +1880,7 @@ init (Handle<Object> target) diff --git a/doc/api.txt b/doc/api.txt index 9928e25eef..9256725c55 100644 --- a/doc/api.txt +++ b/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 diff --git a/doc/node.1 b/doc/node.1 index 9ae853dfbc..fa7b81d33a 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -1,11 +1,11 @@ .\" Title: node .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" 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