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

Account for io being async #98

Merged
merged 1 commit into from
Jan 26, 2016
Merged

Account for io being async #98

merged 1 commit into from
Jan 26, 2016

Conversation

gtanner
Copy link
Contributor

@gtanner gtanner commented Jan 25, 2016

If there are a lot of results, there is a chance of exiting this process before it is finished writing to the console.

Wait for stdout to be finished before exiting.

If there are a lot of results, there is a chance of exiting this process
before it is finished writing to the console.

Wait for stdout to be finished before exiting
@lijunle
Copy link
Member

lijunle commented Jan 25, 2016

Is this serious? There is only one call for console.log or console.error. I think these two operations are synchronous and block the IO. Then, is it no need to wait the finish?

@gtanner
Copy link
Contributor Author

gtanner commented Jan 25, 2016

Yeah ;) console.error and console.warn are sync, but console.log is async, thus needing to wait for stdout to flush.

I was getting half generated JSON output on some larger objects

@gtanner
Copy link
Contributor Author

gtanner commented Jan 25, 2016

@gtanner
Copy link
Contributor Author

gtanner commented Jan 25, 2016

But in the case of someone using child_process.exec to run this, the output is always a stream, which forces stdout to be async.

@codecov-io
Copy link

Current coverage is 98.10%

Merging #98 into master will not affect coverage as of 0843c73

@@            master    #98   diff @@
=====================================
  Files           16     16       
  Stmts          369    369       
  Branches        84     84       
  Methods          0      0       
=====================================
  Hit            362    362       
  Partial          5      5       
  Missed           2      2       

Review entire Coverage Diff as of 0843c73

Powered by Codecov. Updated on successful CI builds.

lijunle added a commit that referenced this pull request Jan 26, 2016
Account for io being async.
@lijunle lijunle merged commit 50ee6c9 into depcheck:master Jan 26, 2016
@lijunle
Copy link
Member

lijunle commented Jan 26, 2016

Great information! Merged! Thanks very much! 🍻

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

Successfully merging this pull request may close these issues.

None yet

3 participants