Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

fix to avoid to much concurrent operations#262

Merged
chrisgorgo merged 3 commits intobids-standard:masterfrom
ntraut:master
Mar 9, 2017
Merged

fix to avoid to much concurrent operations#262
chrisgorgo merged 3 commits intobids-standard:masterfrom
ntraut:master

Conversation

@ntraut
Copy link
Copy Markdown
Contributor

@ntraut ntraut commented Mar 3, 2017

For correcting issue #261: Big dataset problem.

@constellates
Copy link
Copy Markdown
Collaborator

Nice. This looks good to me. Two minor things.

Any of the process.nextTick calls that take a generic async callback don't need the extra anonymous function.

For example this

process.nextTick(function() { cb() });

could be written as this

process.nextTick(cb);

And lastly, for the current npm publishing work flow to work you'll need to up the version number in the package.json file.

Thanks for the PR.

@ntraut
Copy link
Copy Markdown
Contributor Author

ntraut commented Mar 3, 2017

Thanks!
I submitted a new commit taking into account your suggestions.

@constellates
Copy link
Copy Markdown
Collaborator

Oh.. I actually meant the version of the bids validator needs to be changed. So in package.json the version property (line 3) needs to be changed.

{
	"name": "bids-validator",
	"version": "0.20.0",
	"description": "",
	"main": "index.js",
	"repository": {
		"type": "git",
		"url": "https://github.com/INCF/bids-validator.git"
	},
	...
}

Probably a "minor" version bump.

{
	"name": "bids-validator",
	"version": "0.21.0",
	"description": "",
	"main": "index.js",
	"repository": {
		"type": "git",
		"url": "https://github.com/INCF/bids-validator.git"
	},
	...
}

The dependency version updates are probably still a good thing though and it looks like tests are still passing with them.

@ntraut
Copy link
Copy Markdown
Contributor Author

ntraut commented Mar 3, 2017

OK

@chrisgorgo
Copy link
Copy Markdown
Contributor

Is this ready to merge?

@ntraut
Copy link
Copy Markdown
Contributor Author

ntraut commented Mar 7, 2017

For me yes: it is working, and it solved the issues that I encountered with a big number of files.

@chrisgorgo chrisgorgo requested a review from constellates March 8, 2017 20:02
Copy link
Copy Markdown
Collaborator

@constellates constellates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized one big issue with this approach is process.nextTick won't exist in the browser. It looks like there are some polyfills, but they don't seem to be widely used so I'm unsure right now what other problems they might pose.

Here's one example https://www.npmjs.com/package/browser-next-tick

@ntraut have you tried this with keeping the async limit, but not using process.nextTick()?

@ntraut
Copy link
Copy Markdown
Contributor Author

ntraut commented Mar 8, 2017

As you want but I think this issue is outdated because I just tested the browser version and it worked.
You can check on your side, modify my pull request (I think it can possibly work just with the async limit, anyway it is better with it), or reject it.

@constellates
Copy link
Copy Markdown
Collaborator

@ntraut Thanks for testing this in the browser. I just dug into the issue a little deeper and it looks like browserify (a part of our web build flow) automatically shims process.nextTick() during the build process.

So @chrisfilo I'm good with these changes now with the caveat that this means the validator will continue to work in our applications and in node, but anyone else using it in the browser will need to make sure they have a shim for process.nextTick() in place.

We could also build a shim into the validator.

@constellates constellates dismissed their stale review March 9, 2017 00:25

discussed in comments.

@chrisgorgo
Copy link
Copy Markdown
Contributor

Thanks for looking into this.

Wouldn't everyone use browserify before trying to use it in the browser? By saying our applications do you also include "http://incf.github.io/bids-validator"?

@constellates
Copy link
Copy Markdown
Collaborator

Yea by "our applications" I mean the gh-pages and the crn_app repo. There are a number of ways to bundle a library like this for the web, but yes most will likely include shims for various node specifics by default. I just checked and webpack also includes a shim.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants