gracehttp

package
v0.0.0-...-70f1737 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2014 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package gracehttp provides easy to use graceful restart functionality for HTTP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(servers ...*http.Server) error

Serve will serve the given http.Servers and will monitor for signals allowing for graceful termination (SIGTERM) or restart (SIGUSR2).

Types

type App

type App struct {
	Servers []*http.Server
	// contains filtered or unexported fields
}

An App contains one or more servers and associated configuration.

func (*App) Listen

func (a *App) Listen() (bool, error)

Listen will inherit or create new listeners. Returns a bool indicating if we inherited listeners. This return value is useful in order to decide if we should instruct the parent process to terminate.

func (*App) Serve

func (a *App) Serve()

Serve the configured servers, but do not block. You must call Wait at some point to ensure correctly waiting for graceful termination.

func (*App) Wait

func (a *App) Wait() error

Wait for the serving goroutines to finish.

Directories

Path Synopsis
Command testserver implements a test case.
Command testserver implements a test case.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL