Node
Node.run
Starts the event loop for async/sync operations.
Type definition
let run: unit => unit;
Usage
open LwtNode;
Node.run({
let%lwt myDir = Fs.mkdir("myDir");
let%lwt myDir2 = Fs.mkdir("myDir2");
Node.resolved();
});
Node.stop
Stops the running event loop
Type definition
let stop: unit => unit;
Usage
Node.andThen
Handle promise value
Type definition
let andThen: (t('a), 'a => t('b)) => t('b);
Usage
Node.catch
Catch a promise that throws an exception
Type definition
let catch: (unit => t('a), exn => t('a)) => t('a);
Usage
Node.resolved
Creates a resolved promise
Type definition
let resolved: 'a => t('a);
Usage
Node.fail
Creates a rejected promise
Type definition
let fail: exn => t('a);
Usage
Node.cancel
Canel a promise
Type definition
let cancel: t('a) => unit;
Usage