Generates Go code using the Phony actor library from ActorSimulation DSL.
Phony is a Pony-inspired actor library for Go that provides:
- Zero-allocation message passing
- Automatic goroutine management
- Backpressure support
- No locks or channels needed
This generator creates production-ready Go projects with:
- Phony actor implementations
- Callback interfaces for custom behavior
- Go test suites
- GitHub Actions CI/CD
- Complete documentation
Example
simulation = ActorSimulation.new()
|> ActorSimulation.add_actor(:sender,
send_pattern: {:periodic, 100, :msg},
targets: [:receiver])
|> ActorSimulation.add_actor(:receiver)
{:ok, files} = PhonyGenerator.generate(simulation,
project_name: "my_actors",
enable_callbacks: true)
PhonyGenerator.write_to_directory(files, "phony_output/")
Summary
Functions
Generates complete Phony (Go) project files from an ActorSimulation.
Writes generated files to a directory.
Functions
Generates complete Phony (Go) project files from an ActorSimulation.
Options
:project_name(required) - Name of the Go module (snake_case):enable_callbacks(default: true) - Generate callback interfaces:go_version(default: "1.21") - Go version for go.mod
Returns
{:ok, files} where files is a list of {filename, content} tuples
Writes generated files to a directory.