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

🚀 Detect Child Process #575

Closed
Fenny opened this issue Jul 10, 2020 · 2 comments
Closed

🚀 Detect Child Process #575

Fenny opened this issue Jul 10, 2020 · 2 comments

Comments

@Fenny
Copy link
Member

Fenny commented Jul 10, 2020

Add app.IsChild() method to determine if the current process is a result of Prefork and defines as a child process, this method can be useful when Prefork is enabled.

func main() {
	app := fiber.New(&fiber.Settings{
		Prefork: true,
	})
	
	if app.IsChild() {
		log.Println("I'm a child process 👶")
	}

	log.Fatal(app.Listen(3000))
}
@welcome
Copy link

welcome bot commented Jul 10, 2020

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@Fenny
Copy link
Member Author

Fenny commented Jul 11, 2020

Tagged in v1.12.6 👍

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

No branches or pull requests

1 participant