digitalbazaar / rdf-canonize

An implementation of the RDF Dataset Normalization Algorithm in JavaScript.
Other
22 stars 13 forks source link

Add `AbortSignal` instance `signal` option to `canonize` #55

Closed dlongley closed 10 months ago

dlongley commented 1 year ago

Check signal periodically during hash n-quads to see if the caller has aborted the canonize operation. This will allow the caller to do things like this:

canonize({..., {signal: AbortSignal.timeout(1000)}})

Causing canonize to timeout if it doesn't complete in one second.

See: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal

dlongley commented 1 year ago

Consider setting the default signal to AbortSignal.timeout(1000) as well.

dlongley commented 1 year ago

Note: The signal should only be checked once the maxDeepIterations number has been hit and it should default to 0 so that the signal is always checked by default when hash N-degree quads is used.

davidlehn commented 10 months ago

Added in v4.0.0.