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
| const winston = require('winston'); | |
| const { LEVEL } = require('triple-beam'); | |
| const SeverityLookup = { | |
| 'default': 'DEFAULT', | |
| 'silly': 'DEFAULT', | |
| 'verbose': 'DEBUG', | |
| 'debug': 'DEBUG', | |
| 'http': 'notice', | |
| 'info': 'info', |
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
| // UPDATE: Everyone finding this gist via Google! | |
| // Modern kotlinx.coroutines has out-of-the-box support for asyncLazy with the following expression: | |
| // val myLazyValue = async(start = CoroutineStart.LAZY) { ... } | |
| // Use myLazyValue.await() when you need it | |
| // ---------------- public api ---------------- | |
| public interface AsyncLazy<out T> { | |
| public suspend fun value(): T | |
| public fun isInitialized(): Boolean |