Version: v0.6.3 Latest Latest

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

Go to latest
Published: Jun 26, 2021 License: MIT Imports: 8 Imported by: 1




This section is empty.


This section is empty.


This section is empty.


type Mod

type Mod func(cs *ServiceServer)

func WithCtx

func WithCtx(this context.Context) Mod

func WithInjector

func WithInjector(injector *injectors.Injector) Mod

func WithRedisPubSub

func WithRedisPubSub(config redispub.Config) Mod

func WithRedisStreams

func WithRedisStreams(config redispub.Config) Mod

func WithWorkerRegistry

func WithWorkerRegistry(registry *actions.WorkerTemplateRegistry) Mod

type ServiceServer

type ServiceServer struct {
	Ctx         context.Context
	CancelFunc  context.CancelFunc
	Logger      sabuhp.Logger
	ErrGroup    *errgroup.Group
	BusRelay    *sabuhp.BusRelay
	Injector    *injectors.Injector
	Registry    *actions.WorkerTemplateRegistry
	Escalations actions.EscalationNotification
	Workers     *actions.ActionHub
	Bus         sabuhp.MessageBus
	// contains filtered or unexported fields

ServiceServer exists to provide a central connection point to the message bus for the client (browser, CLI app, ...etc). They will never host any functions or processing providers but exists to provide a direct and distributed (by creating horizontally scaled replicas) that allow clients to deliver requests into the underline pubsub bus which will deliver these to service servers who host nothing else but functions and processors.

func New

func New(ctx context.Context, logger sabuhp.Logger, bus sabuhp.MessageBus, mods ...Mod) *ServiceServer

func (*ServiceServer) Init added in v0.4.3

func (c *ServiceServer) Init()

Init allows you to initialize all components for setup as calling ServiceServer.Start with both initialize and start all related servers.

If you wish to use the default setup but customize to fit your needs it's your best interest to call ServiceServer.Init first.

func (*ServiceServer) Start

func (c *ServiceServer) Start()

Start calls ServiceServer.Init first then starts all related servers (http, websocket) etc.

func (*ServiceServer) Wait

func (c *ServiceServer) Wait() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL