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
Link to this function
create(fun)
View Source
create(fun)
View Source
create((keyword() -> Reddex.HTTP.listing_resp())) :: Enumerable.t()
create((keyword() -> Reddex.HTTP.listing_resp())) :: Enumerable.t()
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
Link to this function
create(fun, opts)
View Source
create(fun, opts)
View Source
create((keyword() -> Reddex.HTTP.listing_resp()), keyword()) :: Enumerable.t()
create((term(), keyword() -> Reddex.HTTP.listing_resp()), term()) ::
Enumerable.t()
create((keyword() -> Reddex.HTTP.listing_resp()), keyword()) :: Enumerable.t()
create((term(), keyword() -> Reddex.HTTP.listing_resp()), term()) :: Enumerable.t()
Link to this function
create(fun, arg, opts)
View Source
create(fun, arg, opts)
View Source
create((term(), keyword() -> Reddex.HTTP.listing_resp()), term(), keyword()) ::
Enumerable.t()
create((term(), keyword() -> Reddex.HTTP.listing_resp()), term(), keyword()) :: Enumerable.t()