5 #define Promise_new() Promise_new_(new_pure(Promise))
6 Promise Promise_new_(Promise this);
9 * notify all Promise_then subscribers that this promise has resolved
11 void Promise_resolve(Promise this);
13 #define Promise_then(this, handler, userdata) Promise_then_(this, Promise_new(), handler, userdata)
14 Promise Promise_then_(Promise this, Promise ret, Promise(Promise ret, entity result, entity userdata) handler, entity userdata);
17 * notify all Promise_catch subscribers that this promise has rejected
19 void Promise_reject(Promise this);
21 #define Promise_catch(this, handler, userdata) Promise_catch_(this, Promise_new(), handler, userdata)
22 Promise Promise_catch_(Promise this, Promise ret, Promise(Promise ret, entity err, entity userdata) handler, entity userdata);
29 Promise Promise_sleep(float n);