Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.16 KB

README.md

File metadata and controls

57 lines (43 loc) · 1.16 KB

Pratipad

Pratipad is a declarative framework for describing bidirectional dataflow.

Usage

Dataflow

defmodule Pratipad.Example.Dataflow do
  use Pratipad.Dataflow
  alias Pratipad.Dataflow.{Demand, Output}
  alias Pratipad.Example.Processor.Precipitation

  def declare() do
    Demand <~> Precipitation <~> Output
  end
end

Processor

defmodule Pratipad.Example.Processor.Precipitation do
  alias Pratipad.Processor
  use Processor

  @impl GenServer
  def init(opts \\ []) do
    {:ok, opts}
  end

  @impl Processor
  def process(data, state) do
    # do something with the message
  end
end

See the example repository for details.

Installation

If available in Hex, the package can be installed by adding pratipad to your list of dependencies in mix.exs:

def deps do
  [
    {:pratipad, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/pratipad.