ExPersona.Client.Streamable (ex_persona v0.0.2) View Source
Handle streamable (i.e., paginated) responses from the API.
Link to this section Summary
Functions
Produce a Stream for a given ExPersona.Client.Operation.
Link to this section Types
Specs
t() :: %ExPersona.Client.Streamable{
closed: boolean(),
cursor: String.t(),
operation: ExPersona.Client.Operation.t()
}
Link to this section Functions
Specs
stream!(ExPersona.Client.Operation.t()) :: Enumerable.t()
Produce a Stream for a given ExPersona.Client.Operation.
For instance:
# get 400 accounts
ExPersona.Account.list()
|> ExPersona.stream!()
|> Stream.take(400)
|> Enum.to_list()
|> IO.inspect()