From 89ccafd97465d4a277c7b304f48425dac85fdbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A8=E3=83=BC=E3=81=B5=E3=81=A8=E3=81=B5?= Date: Mon, 18 Jul 2022 15:09:42 +0900 Subject: [PATCH] add: OnFork docs --- guide/hooks.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guide/hooks.md b/guide/hooks.md index 1f54b1a8d8e..fd65f319f13 100644 --- a/guide/hooks.md +++ b/guide/hooks.md @@ -6,6 +6,7 @@ With Fiber v2.30.0, you can execute custom user functions when to run some metho - [OnGroup](#ongroup) - [OnGroupName](#ongroupname) - [OnListen](#onlisten) +- [OnFork](#onfork) - [OnShutdown](#onshutdown) ## Constants @@ -16,6 +17,7 @@ type OnNameHandler = OnRouteHandler type OnGroupHandler = func(Group) error type OnGroupNameHandler = OnGroupHandler type OnListenHandler = func() error +type OnForkHandler = func(int) error type OnShutdownHandler = OnListenHandler ``` @@ -73,6 +75,16 @@ func (app *App) OnListen(handler ...OnListenHandler) ``` {% endcode %} +## OnFork + +OnFork is a hook to execute user functions on Fork. + +{% code title="Signature" %} +```go +func (app *App) OnFork(handler ...OnForkHandler) +``` +{% endcode %} + ## OnShutdown OnShutdown is a hook to execute user functions after Shutdown.