Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost onInit property when clone a Props #829

Closed
tutumagi opened this issue Mar 22, 2023 · 1 comment
Closed

Lost onInit property when clone a Props #829

tutumagi opened this issue Mar 22, 2023 · 1 comment

Comments

@tutumagi
Copy link
Contributor

Describe the bug
Lost onInit property when clone a Props.

To Reproduce

props := actor.PropsFromFunc(func(ctx actor.Context) {
	switch msg := ctx.Message().(type) {
	case *actor.Started:
		fmt.Printf("Started %v", msg)
	case *shared.Hello:
		fmt.Printf("Hello %v\n", msg.Name)
	}
}, actor.WithOnInit(func(ctx actor.Context) {
	// It does not execute the OnInit callback when spawn a "hello" kind actor.
	fmt.Printf("OnInit %v", ctx)  
}))
helloKind := cluster.NewKind("hello", props)

Expected behavior
It can print OnInit {{xxx}} when spawn a "hello" kind actor.

@tutumagi
Copy link
Contributor Author

I create a PR for this. #830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant