1
0
mirror of https://github.com/kataras/iris.git synced 2026-03-14 04:09:37 +00:00

new NonBlocking option and Wait method on Application. See HISTORY.md for more

This commit is contained in:
Gerasimos (Makis) Maropoulos
2024-01-14 06:58:17 +02:00
parent 5ef854d835
commit 70882914d4
5 changed files with 174 additions and 4 deletions

View File

@@ -23,6 +23,28 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
Changes apply to `main` branch.
- New `iris.NonBlocking()` configuration option to run the server without blocking the main routine, `Application.Wait(context.Context) error` method can be used to block and wait for the server to be up and running. Example:
```go
func main() {
app := iris.New()
app.Get("/", func(ctx iris.Context) {
ctx.Writef("Hello, %s!", "World")
})
app.Listen(":8080", iris.NonBlocking())
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
if err := app.Wait(ctx); err != nil {
log.Fatal(err)
}
// [Server is up and running now, you may continue with other functions below].
}
```
- Add `x/mathx.RoundToInteger` math helper function.
# Wed, 10 Jan 2024 | v12.2.9