wiki_elixir v0.1.1 WikiSSE View Source

This module reads from an infinite stream of server-sent events annotating actions such as editing or patrolling, as they happen on Wikimedia projects.

For more about the public wiki streams and their format, see EventStreams on Wikitech

Examples

Start reading the default feed, and expose as a GenStage.stream:

WikiSSE.start_link() WikiSSE.stream() |> Stream.take(6) |> Enum.to_list |> IO.inspect

TODO

  • Track the restart ID, disconnect from the feed at some maximum queue size. Reconnect as demand resumes. Application-lifetime or permanent storage for the restart ID tracking, for consumers that need an at-least-once guarantee.

Link to this section Summary

Link to this section Types

Specs

option() :: {:endpoint, String.t()} | {:send_to, GenServer.server()}

Specs

options() :: [option()]

Link to this section Functions

Specs

start_link(options()) :: GenServer.on_start()

Specs

stream(keyword()) :: Enumerable.t()