Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spawn hangs on long-running process #16

Open
bugs181 opened this issue Sep 18, 2022 · 2 comments
Open

spawn hangs on long-running process #16

bugs181 opened this issue Sep 18, 2022 · 2 comments

Comments

@bugs181
Copy link

bugs181 commented Sep 18, 2022

As far as I can tell, there's no way to get spawn to act like node's spawn with stdout.

Code like the following, simply does not work (because tail -f never finishes, it's a long-running process):

const { spawn } = require('bun-utilities/spawn.js')

const child = spawn('tail', ['-f', 'access.log'])
console.log(child)

Bun version: 0.1.13

In node land, we would listen for events from stdout like so:

const { spawn } = require('child_process')
const child = spawn('tail', ['-f', 'access.log'])

child.on('close', code => { ... })
child.stdout.on('data', data => { ... })

NOTE: exec behaves the same way.

@xhyrom
Copy link
Owner

xhyrom commented Sep 19, 2022

I can try to do something like this

@xhyrom
Copy link
Owner

xhyrom commented Sep 26, 2022

It will be implemented in Bun, Bun.spawn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants