Help us shape the future of Go! Take the 2026 Go Developer Survey

pubsub

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

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

Category is the pubsub category loop handler.

func New

func New(opts Options) *Category

func (*Category) Handle

func (c *Category) Handle(ctx context.Context, e loops.EventCategory) error

Handle dispatches every event the pubsub category loop receives. The bodies of the per-resource cases live in sibling files (subscriber.go, subscription.go).

func (*Category) Loop

func (*Category) Run

func (c *Category) Run(ctx context.Context) error

type Manager

type Manager interface {
	instance.Manager
}

Manager is the slice of the pubsub sub-processor used by this loop. It is just instance.Manager today (Init / Close).

type Options

type Options struct {
	AppID      string
	PubSub     Manager
	Subscriber Subscriber
	CompStore  *compstore.ComponentStore
	Reporter   registry.Reporter
	Security   security.Handler
}

type Subscriber

type Subscriber interface {
	ReloadPubSub(name string) error
	StopPubSub(name string)
	StartAppSubscriptions() error
	StopAppSubscriptions()
	StopAllSubscriptionsForever()
	StartStreamerSubscription(sub *subapi.Subscription, connID rtpubsub.ConnectionID) error
	StopStreamerSubscription(sub *subapi.Subscription, connID rtpubsub.ConnectionID)
	ReloadDeclaredAppSubscription(name, pubsubName string) error
	AddDeclaredAppSubscription(comp *subapi.Subscription, sub rtpubsub.Subscription) error
	InitProgramaticSubscriptions(ctx context.Context) error
}

Subscriber is the slice of the existing subscriber type that this category loop drives. Every method is invoked from inside the category Handle, so they observe loop-serial semantics: concurrent gRPC stream handlers and reconciler events for the same subscription are funnelled through the category queue and executed one at a time.

Jump to

Keyboard shortcuts

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