 Documentation
      ¶
      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" Event_ConnChange = "connchange" Event_SysInfo = "sysinfo" Event_ControllerStatus = "controllerstatus" Event_WaveObjUpdate = "waveobj:update" Event_BlockFile = "blockfile" Event_Config = "config" Event_UserInput = "userinput" Event_RouteGone = "route:gone" )
      View Source
      
  
    const ( FileOp_Append = "append" FileOp_Truncate = "truncate" FileOp_Invalidate = "invalidate" )
      View Source
      
  
    const MaxPersist = 4096
    
      View Source
      
  
const ReMakeArrThreshold = 10 * 1024
    Variables ¶
      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.