Closed hrj closed 8 years ago
You're right. This is a bug in bfs-process, where I implement the _read function incorrectly. I noticed shortly after you posted an issue there, but haven't had time to fix yet. I plan to fix this before releasing a new version of doppio.
As an aside, I have unit tests for this, but they don't test whether or not they never run, so they have been trivially passing for awhile now. Doh!
@jvilk Any update on this one?
Almost finished a fix before the holidays. Will poke at it further this week. Node streams have a weird interface, and I had some subtle issues with unit testing them.
Just fixed this in the latest BrowserFS, which Doppio now depends on. Let me know if you continue to have issues.
Confirmed that this works now. Thanks! However,
stdout.on("ready")
is not fired. stdout.on("data")
works.BrowserFS.install()
, then it doesn't always work. It fails if doppio is being run in a web-worker. The process
object is present but process.stdout
is not immediately present. However, if I wait for the JVM to initialise then process.stdout
is found. I would like to install it as early as possible (so as to not lose any output).I just addressed your second bullet in another BFS release. There's a circular dependency that I had to work around in bfs-process
that BrowserFS now fixes.
I'll look into the ready event.
Actually, is the ready event documented? What's the semantics?
Actually, is the ready event documented? What's the semantics?
Ooops, my bad. I wanted to listen to the readable
event as documented here but I tried ready
by mistake.
Looking again at the documentation, I see no advantage in using readable
over data
.. It is just one of the things I was trying some weeks back to get stdout to work. So it is not a blocker for me.
I just addressed your second bullet in another BFS release. There's a circular dependency that I had to work around in bfs-process that BrowserFS now fixes.
Cool, thanks! I will try that and report if it doesn't work.
I want to print the output from
System.out.println
into the browser console. Based on the code given in the wiki page, I tried something like this:But the handler doesn't ever get called. I also tried registering on the
ready
event:The
ready
event doesn't fire either.The data does get accumulated in the stream however. If I call this in the browser console:
... I can see the data in there.
I have tried this with very old doppio, current npm release, as well as latest master. Any ideas?
Thanks!