package flux
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=96eda206d7eacfb921d5a6bb459254d7f8c507bbc11aa27f1544fb5c73e204c7
sha512=97cf49978fc18946eef5579b004907b2f2a58dc2452446476545385b388eb04bde072020b7a55900be02405f71bebbc919a6039caf636f221167a5d9335ffcce
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.