package exegroup import "context" type ( GoFunc = func(ctx context.Context) error StopFunc = func(ctx context.Context) ) type Actor struct { goFunc GoFunc stopFunc StopFunc name string } func NewActor() *Actor { return &Actor{} } func (actor *Actor) WithName(name string) *Actor { actor.name = name return actor } func (actor *Actor) WithGo(goFunc GoFunc) *Actor { actor.goFunc = goFunc return actor } func (actor *Actor) WithGoStop(goFunc GoFunc, stopFunc StopFunc) *Actor { actor.goFunc = goFunc actor.stopFunc = stopFunc return actor }