Comments (4)
this can more or less only be throttled using
await
.
But that is exactly what the calling code should do, and it solves the issue, no?
Do you have an example of code that could cause issues?
from hdt-node.
This is issue is mostly for documentation so I don't forget. There is no imporant use case, no urgent solution necessary.
Possible problematic code could be this (not the best example):
var doc;
hdt.fromFile('./test/test.hdt')
.then(function(hdtDocument) {
doc = hdtDocument;
for (predicate in predicates) {
doc.searchTriples(null, predicate, null, { offset: 0, limit: 10 }).then(...);
}
});
From the calling code, it's not always easy to predict when you are going to run into trouble (you don't know how many results there are and even if you do, you don't know what will be a problem). The library could improve the dev experience by adding some throttling or at least rejecting too many calls.
from hdt-node.
I would argue the above is an issue in the calling code. A for
loop is not an adequate solution in presence of asynchronous calls. You have to either code this with a callback function, or more easily with for await
.
Native Node.js APIs, such as fs
, will also not contain protections against this and similarly rely on the caller to do the right thing.
As such, I don't think that protections belong in the HDT module.
from hdt-node.
fair enough :)
from hdt-node.
Related Issues (20)
- Read/write the HDT header HOT 3
- Unable to build on Windows HOT 1
- Point submodule to hdt-cpp develop branch HOT 5
- Current version does not install HOT 6
- Fetch distinct predicates HOT 6
- Update TypeScript definitions HOT 2
- A Limit of 0 returns all results HOT 3
- Setting Infinity as limit produces no results
- Fetching distinct predicates, given a subject HOT 1
- Add RDFJS support (and update N3.js) HOT 22
- Develop vs master branch HOT 1
- Inconsistency while searching literal terms and triples with literals HOT 1
- Updating submodule to new hdt-cpp release HOT 1
- Nan API may have changed in Node 12 HOT 4
- Build fails on Node 12.13.0 HOT 4
- Performance test new semver.major
- Update docs for new RDF/JS interface
- Build failing on Node 15
- link in README is broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hdt-node.