service

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEARTBEAT_LIVENESS = 3                       // 3-5 is reasonable
	HEARTBEAT_INTERVAL = 2500 * time.Millisecond // msecs
	HEARTBEAT_EXPIRY   = HEARTBEAT_INTERVAL * HEARTBEAT_LIVENESS
)

TODO: get these from config data

Variables

This section is empty.

Functions

func GetLogger added in v0.1.10

func GetLogger() *kitlog.Logger

Types

type Broker

type Broker struct {
	Socket *zmq.Socket // Socket for clients & workers

	Waiting     []*Worker // List of waiting workers
	HeartbeatAt time.Time // When to send HEARTBEAT
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker(logger *kitlog.Logger) (broker *Broker, err error)

func (*Broker) Bind

func (b *Broker) Bind(endpoint string) (err error)

func (*Broker) ClientMsg

func (b *Broker) ClientMsg(sender string, msg []string)

func (*Broker) Close

func (b *Broker) Close() (err error)

func (*Broker) Purge

func (b *Broker) Purge()

func (*Broker) Run

func (b *Broker) Run(done chan bool)

func (*Broker) ServiceRequire

func (b *Broker) ServiceRequire(service_frame string) (service *Service)

func (*Broker) WorkerMsg

func (b *Broker) WorkerMsg(sender string, msg []string)

func (*Broker) WorkerRequire

func (b *Broker) WorkerRequire(identity string) (worker *Worker)

type Bus added in v0.1.6

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

func NewBus added in v0.1.6

func NewBus(name string, unit string, config *context.Config, logger *kitlog.Logger) *Bus

func (*Bus) Run added in v0.1.6

func (b *Bus) Run(done chan bool)

type Endpoint

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

func NewEndpoint

func NewEndpoint(name string, client *api.Client, config *context.Config, log *logging.Logger) *Endpoint

type Relay

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

func NewRelay

func NewRelay(config *context.Config, logger *kitlog.Logger) *Relay

func (*Relay) Run

func (r *Relay) Run(done chan bool)

type Service

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

func (*Service) Dispatch

func (s *Service) Dispatch(msg []string)

type Unit added in v0.1.1

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

func NewUnit added in v0.1.1

func NewUnit(name string) (*Unit, error)

func (*Unit) Start added in v0.1.1

func (u *Unit) Start()

type Worker

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

func (*Worker) Delete

func (w *Worker) Delete(disconnect bool)

func (*Worker) Send

func (w *Worker) Send(command, option string, msg []string) (err error)

func (*Worker) Waiting

func (w *Worker) Waiting()

Jump to

Keyboard shortcuts

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