-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathInitPresent.js
More file actions
22 lines (18 loc) · 848 Bytes
/
InitPresent.js
File metadata and controls
22 lines (18 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// console.log("******** enter the init block ********");
let resolved = false;
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms)).then(() => {resolved = true});
}
exports.initializeFunction = async () => {
// console.log("******** enter initializeFunction hook ********");
// console.log("******** Is promised resolved? " + resolved + " ********");
// console.log("******** sleep for 20 ms... ********")
let p = await sleep(20);
// console.log("******** wake up ********");
// console.log("******** Is promised resolved? " + resolved + " ********");
}
exports.handler = async (event, context) => {
// console.log("******** enter the handler ********");
// console.log("******** Is promised resolved? " + resolved + " ********");
return ( resolved ? true: false );
}