-
Notifications
You must be signed in to change notification settings - Fork 17
Provide an OnStart handler on server.Restate #80
Copy link
Copy link
Open
Description
I want my services to self-register their deployment and perform other tasks like initializing cron jobs after the server starts. Currently there is no way to know if the server is started. I am using a combination of goroutines and time.Sleep to approximate what I want. I envision something like this:
func main() {
server.NewRestate().
Bind(restate.Reflect(NewMyService()).
OnStart(handleRestateStart).
Start(ctx, addr)
}
func handleRestateStart() {
// register restate deployment (use force=false in multi-pod environments)
// register cron jobs
// invoke other startup features that depend on restate
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels