Repository navigation
v0.23.0
Changed
- On Erlang,
splitmatched a nonempty delimiter only against whole grapheme clusters, so"\r"did not match inside CRLF and"e"did not match before a combining mark, unless a chunk boundary fell there. It now matches code points on both targets, independent of chunk boundaries. Erlang callers that split CRLF text on"\r"now get pieces that start with"\n", as on JavaScript.
Fixed
- Close resources when a callback raises during a terminal operation. A raise in
map, a terminal callback, or a resource's ownnextused to leave the resource open or close it at a stale state, and a resource opened during the raising pull was never closed. Each resource now closes once at its latest state, newest first, before the exception continues. Exceptions fromcloseduring that cleanup are discarded so the original exception is reported. - A raising consumer of
broadcast,broadcast_bounded, orunzipreleases its queue, so the other consumers keep reading and a bounded broadcast no longer reportsQueueLimitExceededfor the abandoned consumer. If the shared upstream raises, it is closed, and each other consumer raises after reading its queued values instead of ending as if the upstream had finished. - On Erlang, a raise in the consumer stops the workers started by
merge,race,timeout, the time operators,map_ordered,map_unordered, andeach_unordered, and closes their sources. They used to keep running until the consumer process exited. A source that raises inside a worker is closed before the worker exits. - On JavaScript, a callback that raises during an async iterator's
next()closes the resources the iterator opened, including one opened by that pull.return()andthrow()report a raisingclosethrough their promise instead of throwing synchronously, andthrow(error)always rejects witherror. split(on: "")no longer resegments the whole unfinished grapheme for each chunk. A grapheme of 30,000 code points delivered one code point per chunk took about 40 seconds on Erlang; it now takes linear time.
Documentation
- Document the cleanup contract for raising callbacks in the module,
resource,timeout,to_async_iterable, the README, and the JavaScript guide, and remove the best-effort caveats. Document thatsplitmatches delimiters by code points. - Rewrite the dataprep example for dataprep 0.27, whose API is the single
dataprepmodule.
Install
gleam add datastreamSee HexDocs for the API
reference.