Pratipad is a declarative framework for describing bidirectional 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
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.
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.