From f0611e53ce7384ada9e3c71097e97764cc069709 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sun, 23 Nov 2025 13:41:05 -0500 Subject: [PATCH] examples/panic: Make the actor resettable --- examples/panic/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/panic/main.go b/examples/panic/main.go index 4e6763e..cfa44eb 100644 --- a/examples/panic/main.go +++ b/examples/panic/main.go @@ -18,7 +18,8 @@ func main() { // actor is an incorrectly implemented actor that panics and errs randomly. type actor struct { } -var _ camfish.Runnable = new(actor) +var _ camfish.Runnable = new(actor) +var _ camfish.Resettable = new(actor) func (this *actor) Type() string { return "panic" } func (this *actor) Run(ctx context.Context) error { @@ -33,3 +34,8 @@ func (this *actor) Run(ctx context.Context) error { } } } + +func (this *actor) Reset(ctx context.Context) error { + log.Println("(i) [panic] here is where we would reset the actor") + return ctx.Err() +}