This file contains 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
'use strict' | |
const asyncHooks = require('async_hooks') | |
const asyncIds = new Set() | |
const asyncHook = asyncHooks.createHook({ | |
init (asyncId, type, triggerAsyncId, resource) { | |
const eid = asyncHooks.executionAsyncId() | |
process._rawDebug(`${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}`, resource) |
This file contains 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
Write-Host "Downloading Redis..." -ForegroundColor Cyan | |
$redisRoot = "$env:SYSTEMDRIVE\Redis" | |
$zipPath = "$($env:USERPROFILE)\redis-2.8.19.zip" | |
(New-Object Net.WebClient).DownloadFile('https://github.com/MSOpenTech/redis/releases/download/win-2.8.19/redis-2.8.19.zip', $zipPath) | |
7z x $zipPath -y -o"$redisRoot" | Out-Null | |
del $zipPath | |
Write-Host "Installing Redis as a Windows service..." | |
& "$redisRoot\redis-server.exe" --service-install |
This file contains 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
var stream = require('stream') | |
var rs = new stream.Readable() | |
rs.push('hello') | |
rs.push('world') | |
rs._read = function() {} | |
var sameTick = true | |
rs.on('data', function() { |