DSpace.API.StreamBuilder (dspace_ex v0.1.0-alpha2)

Copy Markdown View Source

Default implementation for streaming of paginated collections from the API.

This module is usually not used directly. Streaming functionality is used through resource modules:

items =
  DSpace.API.Item.list()
  |> DSpace.API.stream!(client)
# Yields: [item1, item2, item3], [item4, item5, item6], ...

Summary

Functions

Creates a stream for paginated API responses.

Functions

new(client, operation, options)

@spec new(DSpace.API.t(), struct(), keyword()) :: Enumerable.t()

Creates a stream for paginated API responses.

Parameters

  • client - The DSpace.API.t/0 client structure to use for the request.
  • operation - The operation to perform, configured with a transformer that returns the response as a tuple {items, meta, next} where items is a list of resources, meta is metadata, and next is the URL for the next page or nil if there are no more pages.
  • options - Keyword list of request options.