server

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package server defines the lifecycle contract implemented by Keelith transports, workers, jobs, and operational endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Named

type Named interface {
	// Name returns the server's diagnostic name.
	Name() string
}

Named gives a Server a stable diagnostic name.

type Server

type Server interface {
	// Start starts the server and returns only after it can accept work.
	Start(context.Context) error
	// Stop stops the server and returns only after it has terminated.
	Stop(context.Context) error
}

Server is a synchronously started, gracefully stopped runtime component.

Start must return only after the component can accept work. Stop must be idempotent.

type Waiter

type Waiter interface {
	// Wait waits for the server to terminate and returns only after it has
	// terminated.
	Wait() error
}

Waiter reports when a started Server terminates.

Waiter is optional so simple lifecycle components only need to implement Server. Stop must cause an implementation's Wait method to return.

Jump to

Keyboard shortcuts

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