skuld_port
Port/adapter boundaries for Skuld: dispatch to pluggable backends, typed contracts, and bridge adapters.
What's included
Skuld.Effects.Port— parameterized dispatch to pluggable backendsSkuld.Effects.Port.EffectfulFacade— typed effectful contracts viadefcallbackSkuld.Adapter— bridges effectful implementations to plain Elixir interfacesSkuld.Adapter.EffectfulContract— plain behaviour contracts for adaptersSkuld.Effects.Command— unified command dispatch pipelineSkuld.Effects.Transaction— env state rollback with optional database transactions
Installation
def deps do
[
{:skuld_port, "~> 0.32"}
]
end
Quick start
use Skuld.Syntax
alias Skuld.Effects.{Port, Throw}
comp do
{:ok, user} <- Port.request(MyApp.Users, :get_user, [user_id])
user
end
|> Port.with_handler(%{MyApp.Users => MyApp.Users.Impl})
|> Throw.with_handler()
|> Comp.run!()
See the architecture guide for how this fits into the Skuld ecosystem.