Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mod ¶
type Mod func(cs *ServiceServer)
func WithInjector ¶
func WithRedisPubSub ¶
func WithRedisStreams ¶
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