package flux
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ad74df51aaf796f4ed14f56296380a3aa795a8d6f9217b6383c9ac833ff334fc
sha512=4d03ef0130a0df993dd3e1c879c45162e57f48c2535f115f23e572214f365a7a052056c89661b4d7bc198209c0adf57dae6f96ea82b6b5c5f30223b653a29f5c
doc/flux/Flux/Flow/index.html
Module Flux.FlowSource
Transforming a flow.
A flow with all elements transformed with a mapping function.
A flow with all elements passed through an effectful function.
A flow that includes only elements that satisfy a predicate.
filter_map fn applies fn to element, discarding it if fn x produces None, and keeping the transformed value otherwise.
bounds limits the consumption of an infinite source to a source with bounded memory consumption. Indeed, the effective aspect of consuming a source, transforming it, and producing a final value (in other words, Stream.run) can lead (depending on the source) to a peak in memory usage that will only end when the process terminates, leaving no room for other processes to run (in parallel and/or cooperatively) correctly (and surely ending in an Out_of_memory exception if we are in a restricted context).
split_on_char sep is a flow which emits (possibly empty) subtrings of incoming elements that are delimited by the character sep.
bstr ~len allocates a bigarray of len bytes and copies the incoming strings into this bigarray. Once it is full, it is transferred to the next consumer.
NOTE: the consumer must immediately consume, in one way or another, the given bigarray. bstr reuses this same bigarray (and does not allocate a new one) to refill it with the incoming strings.
Composing flows.
Compose two flows to form a new flow.