Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miladrahimi authored Aug 20, 2021
1 parent 78fbbd0 commit 58aae90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,17 @@ One of the GoLobby Config features is the ability to update the configuration st
It takes advantage of OS signals to handle this requirement.
Config instances listen to the "SIGHUP" operating system signal and refresh structs like calling the `Refresh()` method.

To enable the listener for a Config instance, you should call the `WithListener()` method.
It gets a fallback function and calls it when the `Refresh()` method fails and returns an error.

```go
c := config.New(feeder).WithListener(func(err error) {
fmt.Println(err)
})

err := c.Feed(&myConfig)
```

You can send the `SIGHUP` signal to your running application with the following shell command.

```shell script
Expand Down

0 comments on commit 58aae90

Please sign in to comment.