examples/panic: Make the actor resettable
This commit is contained in:
@@ -18,7 +18,8 @@ func main() {
|
|||||||
|
|
||||||
// actor is an incorrectly implemented actor that panics and errs randomly.
|
// actor is an incorrectly implemented actor that panics and errs randomly.
|
||||||
type actor struct { }
|
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) Type() string { return "panic" }
|
||||||
|
|
||||||
func (this *actor) Run(ctx context.Context) error {
|
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()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user