Documentation
¶
Overview ¶
wave pubsub system
Index ¶
- Constants
- Variables
- type BrokerSubscription
- type BrokerType
- func (b *BrokerType) GetClient() Client
- func (b *BrokerType) Publish(event WaveEvent)
- func (b *BrokerType) ReadEventHistory(eventType string, scope string, maxItems int) []*WaveEvent
- func (b *BrokerType) SendUpdateEvents(updates waveobj.UpdatesRtnType)
- func (b *BrokerType) SetClient(client Client)
- func (b *BrokerType) Subscribe(subRouteId string, sub SubscriptionRequest)
- func (b *BrokerType) Unsubscribe(subRouteId string, eventName string)
- func (b *BrokerType) UnsubscribeAll(subRouteId string)
- type Client
- type SubscriptionRequest
- type WSFileEventData
- type WaveEvent
Constants ¶
View Source
const ( Event_BlockClose = "blockclose" // type: string Event_ConnChange = "connchange" // type: wshrpc.ConnStatus Event_SysInfo = "sysinfo" // type: wshrpc.TimeSeriesData Event_ControllerStatus = "controllerstatus" // type: *blockcontroller.BlockControllerRuntimeStatus Event_BuilderStatus = "builderstatus" // type: wshrpc.BuilderStatusData Event_BuilderOutput = "builderoutput" // type: map[string]any Event_WaveObjUpdate = "waveobj:update" // type: waveobj.WaveObjUpdate Event_BlockFile = "blockfile" // type: *WSFileEventData Event_Config = "config" // type: wconfig.WatcherUpdate Event_UserInput = "userinput" // type: *userinput.UserInputRequest Event_RouteDown = "route:down" // type: none Event_RouteUp = "route:up" // type: none Event_WorkspaceUpdate = "workspace:update" // type: none Event_WaveAIRateLimit = "waveai:ratelimit" // type: *uctypes.RateLimitInfo Event_WaveAppAppGoUpdated = "waveapp:appgoupdated" // type: none Event_TsunamiUpdateMeta = "tsunami:updatemeta" // type: wshrpc.AppMeta Event_AIModeConfig = "waveai:modeconfig" // type: wconfig.AIModeConfigUpdate Event_TabIndicator = "tab:indicator" // type: wshrpc.TabIndicatorEventData Event_BlockJobStatus = "block:jobstatus" // type: wshrpc.BlockJobStatusData )
IMPORTANT: When adding a new event constant, you MUST also:
- Add a "// type: <TypeName>" comment (use "none" if no data is sent)
- Add the constant to AllEvents below
- Add an entry to WaveEventDataTypes in pkg/tsgen/tsgenevent.go - Use reflect.TypeOf(YourType{}) for value types - Use reflect.TypeOf((*YourType)(nil)) for pointer types - Use nil if no data is sent for the event
View Source
const ( FileOp_Create = "create" FileOp_Delete = "delete" FileOp_Append = "append" FileOp_Truncate = "truncate" FileOp_Invalidate = "invalidate" )
View Source
const MaxPersist = 4096
Variables ¶
View Source
var AllEvents []string = []string{ Event_BlockClose, Event_ConnChange, Event_SysInfo, Event_ControllerStatus, Event_BuilderStatus, Event_BuilderOutput, Event_WaveObjUpdate, Event_BlockFile, Event_Config, Event_UserInput, Event_RouteDown, Event_RouteUp, Event_WorkspaceUpdate, Event_WaveAIRateLimit, Event_WaveAppAppGoUpdated, Event_TsunamiUpdateMeta, Event_AIModeConfig, Event_TabIndicator, Event_BlockJobStatus, }
View Source
var Broker = &BrokerType{ Lock: &sync.Mutex{}, SubMap: make(map[string]*BrokerSubscription), PersistMap: make(map[persistKey]*persistEventWrap), }
Functions ¶
This section is empty.
Types ¶
type BrokerSubscription ¶
type BrokerSubscription struct {
AllSubs []string // routeids subscribed to "all" events
ScopeSubs map[string][]string // routeids subscribed to specific scopes
StarSubs map[string][]string // routeids subscribed to star scope (scopes with "*" or "**" in them)
}
func (*BrokerSubscription) IsEmpty ¶
func (bs *BrokerSubscription) IsEmpty() bool
type BrokerType ¶
type BrokerType struct {
Lock *sync.Mutex
Client Client
SubMap map[string]*BrokerSubscription
PersistMap map[persistKey]*persistEventWrap
}
func (*BrokerType) GetClient ¶
func (b *BrokerType) GetClient() Client
func (*BrokerType) Publish ¶
func (b *BrokerType) Publish(event WaveEvent)
func (*BrokerType) ReadEventHistory ¶
func (b *BrokerType) ReadEventHistory(eventType string, scope string, maxItems int) []*WaveEvent
does not take wildcards, use "" for all
func (*BrokerType) SendUpdateEvents ¶
func (b *BrokerType) SendUpdateEvents(updates waveobj.UpdatesRtnType)
func (*BrokerType) SetClient ¶
func (b *BrokerType) SetClient(client Client)
func (*BrokerType) Subscribe ¶
func (b *BrokerType) Subscribe(subRouteId string, sub SubscriptionRequest)
if already subscribed, this will *resubscribe* with the new subscription (remove the old one, and replace with this one)
func (*BrokerType) Unsubscribe ¶
func (b *BrokerType) Unsubscribe(subRouteId string, eventName string)
func (*BrokerType) UnsubscribeAll ¶
func (b *BrokerType) UnsubscribeAll(subRouteId string)
type SubscriptionRequest ¶
type WSFileEventData ¶
Click to show internal directories.
Click to hide internal directories.