daemonservice

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package daemonservice implements a service which runs and communicates with a separate daemon subprocess.

Index

Constants

This section is empty.

Variables

View Source
var RespawnDelay = time.Minute

RespawnDelay is the minimum time between process starts. It exists to limit the speed of crash loops, it is variable to support testing.

Functions

func Factory

func Factory(conf *fspb.ClientServiceConfig) (service.Service, error)

Factory is a service.Factory returning a Service configured according to the provided configuration proto.

Types

type Service

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

Service implements service.Service, delegating message processing to a subprocess.

func (*Service) ProcessMessage

func (s *Service) ProcessMessage(ctx context.Context, m *fspb.Message) error

ProcessMessage implements service.Service by passing m to the dependent subprocess.

func (*Service) Start

func (s *Service) Start(sc service.Context) error

Start starts the service, starting the subprocess unless LazyStart.

func (*Service) Stop

func (s *Service) Stop() error

Stop implements service.Service to stop the service. This kills the current subprocess. Returns the cause which caused the process to exit, or nil in case of an intentional shutdown.

Directories

Path Synopsis
Package client is a go client library for daemonservice.
Package client is a go client library for daemonservice.
Package command provides a relatively thin wrapper around exec.Cmd, adding support for communicating with the dependent process using a channel.Channel.
Package command provides a relatively thin wrapper around exec.Cmd, adding support for communicating with the dependent process using a channel.Channel.
Package execution provides an abstraction for a single execution of a command with the context of daemonservice.
Package execution provides an abstraction for a single execution of a command with the context of daemonservice.
proto
Package testclient implements a daemonservice client meant for testing.
Package testclient implements a daemonservice client meant for testing.

Jump to

Keyboard shortcuts

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