summaryrefslogtreecommitdiff
path: root/tools/manpages.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-03-06 20:07:41 -0300
committerEuAndreh <eu@euandre.org>2024-03-06 20:18:05 -0300
commit40118a188fb05219d1188ff775ce71f66c8cb56a (patch)
tree85d4f39c5b3bb9b0bf342bf9b3e364c21fd16be6 /tools/manpages.sh
parentsrc/hero.mjs: Change server.listen() to receive no arguments (diff)
downloadpapod-40118a188fb05219d1188ff775ce71f66c8cb56a.tar.gz
papod-40118a188fb05219d1188ff775ce71f66c8cb56a.tar.xz
src/hero.mjs: Add simplified implementation of `makePipeReader()`
There are a few limitations of the current approach that I didn't figure out how to solve yet: 1. when stopping the server, mainly for shutting down the Node.js process when running the tests, we need to open and close the pipe in write mode at least once, otherwise it hangs forever. After opening and closing it, the "autoClose" functionality of the `fs.createReadStream()` kicks in, and it closes, otherwise the test hangs forever as Node.js still has open handles. That's why the `server.close()` function has a gratuitous call to `fs.createWriteStream(pipe).end()`: so that when stopping the server, the pipe is always closed at least once; 2. when actually running the application, if one tries an IPC command like: $ echo '{ "action": "config-dump" }' > web.pipe It works, but only for the first time. As this shell line opened the pipe, wrote to it and then closed it, the reader that `makePipeReader()` constructed closed, but didn't open it again. So when running the exact same IPC command for a second time, the shell hangs, as there is no process on the other side listening for the command and consuming the pipe. Shortcoming nº 2 is much more important to be solved, as we can live with shortcoming nª 1 for some time. Both are to be fixed in the near future.
Diffstat (limited to 'tools/manpages.sh')
0 files changed, 0 insertions, 0 deletions