runnable

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance interface {
	Name() string
	Start() error
	Stop() error
	GracefulStop() error
}

Runnable represents a runnable instance.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages a set of runnables.

func NewManager

func NewManager() *Manager

NewManager returns a new empty runnable manager.

func (*Manager) Add

func (c *Manager) Add(runnable Instance)

Add a new runnable.

func (*Manager) AddServer

func (c *Manager) AddServer(listenAddress string, server Server)

AddServer adds a new server.

func (*Manager) GracefulStop

func (c *Manager) GracefulStop() error

GracefulStop gracefully stops all runnables.

func (*Manager) Run

func (c *Manager) Run() error

Run starts all runnables.

func (*Manager) Stop

func (c *Manager) Stop() error

Stop all runnables.

type Server

type Server interface {
	Instance
	Listen(address string) error
	Close() error
}

Server represents a runnable server.

Jump to

Keyboard shortcuts

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