This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2019-03-29 20:52:14 | |
| Full thread dump OpenJDK 64-Bit Server VM (11.0.2+9 mixed mode): | |
| Threads class SMR info: | |
| _java_thread_list=0x00007fcb140093e0, length=34, elements={ | |
| 0x00007fcb58017800, 0x00007fcb5811f000, 0x00007fcb58123000, 0x00007fcb58135800, | |
| 0x00007fcb58137800, 0x00007fcb5813a000, 0x00007fcb5813c000, 0x00007fcb5819d000, | |
| 0x00007fcb581aa000, 0x00007fcb58ac3000, 0x00007fcb58ae6000, 0x00007fcb58ae1000, | |
| 0x00007fcb04bb9000, 0x00007fcb04bbb000, 0x00007fcb04c67000, 0x00007fcb04c68000, | |
| 0x00007fcb04c69800, 0x00007fcb04c6b800, 0x00007fcb04c6d800, 0x00007fcb04c78000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getUserData() | |
| .then(getUserData) | |
| .then(doMoreStuff) | |
| .then(getEvenMoreUserData) | |
| .then(doEvenMoreStuff) | |
| .then(getYetMoreUserData) | |
| .then(doYetMoreStuff); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function co(generator) { | |
| return new Promise((resolve, reject) => { | |
| const g = generator(); | |
| function onResolve(value) { | |
| let ret; | |
| try { | |
| ret = g.next(value); | |
| } catch (e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function deferred(val) { | |
| return new Promise((resolve, reject) => resolve(val)); | |
| } | |
| function deferReject(e) { | |
| return new Promise((resolve, reject) => reject(e)); | |
| } | |
| co(function* asyncAdds() { | |
| console.log(yield deferred('We are starting!')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function co(generator) { | |
| return new Promise((resolve, reject) => { | |
| const g = generator(); | |
| function next(nextVal) { | |
| const ret = g.next(nextVal); | |
| if (ret.done) { | |
| return resolve(ret.value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function deferred(val) { | |
| return new Promise((resolve, reject) => resolve(val)); | |
| } | |
| co(function* asyncAdds() { | |
| console.log(yield deferred(1)); // 1 | |
| console.log(yield deferred(2)); // 2 | |
| console.log(yield deferred(3)); // 3 | |
| return 4; | |
| }).then(function (result) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function () { | |
| var user = await fetchJson('/api/user/self'); | |
| var interests = await fetchJson('/api/user/interests?userId=' + self.id); | |
| var recommendations = await Promise.all( | |
| interests.map(i => fetchJson('/api/recommendations?topic=' + i))); | |
| render(user, interests, recommendations); | |
| }(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function adder(initialValue) { | |
| let state = 'initial'; | |
| let done = false; | |
| let sum = initialValue; | |
| let lastSum; | |
| let temp; | |
| function go(input, err) { | |
| let result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function* adder(initialValue) { | |
| let sum = initialValue; | |
| let lastSum = initialValue; | |
| let temp; | |
| while (true) { | |
| try { | |
| temp = sum; | |
| sum += yield sum; | |
| lastSum = temp; | |
| } catch (e) { |
NewerOlder