examples/panic: Make the actor resettable
This commit is contained in:
parent
c0064323d8
commit
f0611e53ce
@ -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()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user