services

package
v1.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package services provides mechanisms to start multiple services in the background

Index

Constants

View Source
const DefaultServiceTimeout = 15 * time.Second

Variables

This section is empty.

Functions

func Run

func Run(services []Service)

The Run function serves as a very simple supervisor: it will start all the services provided to it and will run until the first of them finishes. Next it will try to stop the remaining services or timeout if they take too long

Types

type Service

type Service interface {
	fmt.Stringer

	// Start a service that will run until completion or until the context is
	// canceled
	Start(ctx context.Context) error
}

A service that runs in the background endlessly until the context is canceled

var (
	GraphQLServer Service = simpleService{
					// contains filtered or unexported fields
	}
	Indexer Service = simpleService{
			// contains filtered or unexported fields
	}
)

Jump to

Keyboard shortcuts

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