reddex v0.1.0 Reddex.Stream View Source

Streams listings.

Link to this section Summary

Functions

Creates an infinite stream of unique results from the listing function fun. Options are passed on to fun, with the exception of :interval, which specifies the number of milliseconds between requests (30000 by default)

Link to this section Functions

Creates an infinite stream of unique results from the listing function fun. Options are passed on to fun, with the exception of :interval, which specifies the number of milliseconds between requests (30000 by default).

Examples

iex> result = Reddex.Stream.create(&Reddex.API.Me.inbox/1) |> Enum.take(1)
iex> match?([%{id: _id}], result)
true

iex> result = Reddex.Stream.create(&Reddex.API.Subreddit.new/2, "all", limit: 100) |> Enum.take(1)
iex> match?([%{id: _id}], result)
true