streamz
streamz copied to clipboard
Elixir Streams and Utilities for Streaming.
We have defined a message format for GenEvent.Stream. https://github.com/elixir-lang/elixir/blob/ab9450d92ff1582ad9ce11e6ec4baf450a07e00e/lib/elixir/lib/gen_event/stream.ex#L107 If merge were to conform to that format then Stream.merge can easily accept messages directly from GenEvent.Stream.
Should tasks be connectable? Is there another construct that looks similar to a task that should be? If we provide a default implementation for Connectable that supports Streams, then a...
First pass at a protocol is https://github.com/hamiltop/streamz/blob/6c416d02b0204b62862504b3f3b8a2f62541cab7/lib/streamz/merge.ex#L93 The goal is to make this more generic (not just specific to merge). Initial thought is: ``` elixir defprotocol Connectable do def connect(source,...
TCPServer is going to be implemented as a stream of streams. It seems a little excessive, but that's sort of what Streamz is about. We won't know how useful something...
Fork GenEvent into this repo. Lots of interesting things to explore: GenEvent.connect/3 GenEvent.stream(manager, connect: false)
``` elixir @spec peek(Enumerable.t) :: {any, Enumerable.t} def peek(stream) do {value, cont} = Enumerable.reduce(stream, fn (acc, el) -> # take one # return continuation function ) {value, Stream.concat([value], cont)} end...
Spec: ``` elixir @spec collapse(Enumerable.t, (Enumerable.t -> [Enumerable.t]), (Enumerable.t -> any)) :: Enumerable.t def collapse(stream, grouper, reducer) ``` Example: ``` elixir uniq_values = Streamz.collapse(values, &Stream.chunk(&1, 100), &Stream.uniq/1) |> Enum.uniq ```...
Spec: ``` elixir @spec farm(Enumerable.t, (Enumerable.t -> [Enumerable.t]), (any -> any), ([Enumerable.t] -> Enumerable)) :: Enumerable.t def farm(stream, distribute, map, reduce) ``` Example code: ``` elixir common_friends = Streamz.farm( users,...
Given that you have no control over what the request process does in terms of spawning other processes, would you be safer creating a supervisor and a process per request,...