fetch-sparql-endpoint
Advanced tools
Comparing version 3.1.1 to 3.2.0
@@ -26,2 +26,3 @@ /// <reference types="node" /> | ||
readonly sparqlXmlParser: SparqlXmlParser; | ||
readonly timeout: number; | ||
constructor(args?: ISparqlEndpointFetcherArgs); | ||
@@ -103,2 +104,3 @@ /** | ||
additionalUrlParams?: URLSearchParams; | ||
timeout?: number; | ||
/** | ||
@@ -105,0 +107,0 @@ * A custom fetch function. |
@@ -36,2 +36,3 @@ "use strict"; | ||
}; | ||
this.timeout = args.timeout || 5000; | ||
} | ||
@@ -178,3 +179,7 @@ /** | ||
async handleFetchCall(url, init, options = {}) { | ||
const controller = new abort_controller_1.default(); | ||
init.signal = controller.signal; | ||
const id = setTimeout(() => controller.abort(), this.timeout); | ||
const httpResponse = await (this.fetchCb || fetch)(url, init); | ||
clearTimeout(id); | ||
let responseStream; | ||
@@ -181,0 +186,0 @@ // Handle response body |
{ | ||
"name": "fetch-sparql-endpoint", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "A simple, lightweight module to send queries to SPARQL endpoints and retrieve their results in a streaming fashion.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -47,3 +47,4 @@ # Fetch SPARQL Endpoint | ||
dataFactory: DataFactory, // A custom RDFJS data factory | ||
prefixVariableQuestionMark: false // If variable names in bindings should be prefixed with '?', defaults to false | ||
prefixVariableQuestionMark: false, // If variable names in bindings should be prefixed with '?', defaults to false | ||
timeout: 5000 // Timeout for setting up server connection (Once a connection has been made, and the response is being parsed, the timeout does not apply anymore). | ||
}); | ||
@@ -50,0 +51,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54832
463
155