Skip to content

pipeline keyword — supervised multi-stage data flows #104

@gregwinn

Description

@gregwinn

Summary

Declarative multi-stage data pipelines as a language construct. Each stage runs as a supervised BEAM process with configurable concurrency, retry, timeout, and backpressure. Like Elixir's GenStage/Flow but zero boilerplate.

Syntax

pipeline OrderProcessor
  stage :validate do |order|
    Changeset.validate(order)
  end

  stage :charge, retry: 3, timeout: 5000 do |order|
    PaymentService.charge(order)
  end

  stage :fulfill, concurrency: 5 do |order|
    WarehouseService.ship(order)
  end

  stage :notify, async: true do |result|
    Email.send(result.user, result)
  end
end

# Start supervised pipeline
OrderProcessor.start()
OrderProcessor.push(order)

Design

  • Each stage is an agent (agent keyword — stateful actors as a language primitive #102) — stateful, supervised, hot-reloadable
  • Backpressure via demand-driven message passing between stages
  • Options: retry, timeout, concurrency (parallel workers per stage), async
  • Supervision tree auto-generated: one supervisor per pipeline, one child per stage

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/languageLanguage syntax and semanticsarea/runtimeRuntime modules (winn_runtime.erl, stdlib)enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions