AuditTrail.Task (audit_trail v0.1.1)

Copy Markdown

Drop-in wrappers for Task that propagate the actor context to child processes.

Use instead of Task.async/Task.start when spawning work that should carry the current user's audit context.

AuditTrail.Task.async(fn -> Repo.update(changeset) end)
AuditTrail.Task.start(fn -> send_notification(user) end)

Summary

Functions

async(fun)

await(task, timeout \\ 5000)

start(fun)

start_link(fun)