Forge.Source.Static (Forge v0.1.1)

View Source

Static source that provides a pre-defined list of samples.

Useful for testing and small datasets where all data is available in memory.

Options

  • :data - List of data maps (required)

Examples

# In pipeline config
source Forge.Source.Static, data: [
  %{value: 1},
  %{value: 2},
  %{value: 3}
]

# Direct usage
{:ok, state} = Forge.Source.Static.init(data: [%{x: 1}, %{x: 2}])
{:ok, samples, state} = Forge.Source.Static.fetch(state)
{:done, _state} = Forge.Source.Static.fetch(state)