Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventListener ¶
type EventListener struct {
// contains filtered or unexported fields
}
EventListener provides information about how many events a listener has processed and a mechanism to stop the listener goroutine
func NewEventListener ¶
func NewEventListener(onSave func(), onInvalidate func()) *EventListener
NewEventListener creates a new EventListener that may perform additional work after propagating cache saves and invalidations
func SimpleEventListener ¶
func SimpleEventListener() *EventListener
SimpleEventListener creates a new EventListener that solely propagates cache updates and invalidations
func (*EventListener) Listen ¶
func (e *EventListener) Listen(cache stored_requests.Cache, events EventProducer)
Listen is meant to be run as a goroutine that updates/invalidates the cache when events occur
type EventProducer ¶
type EventProducer interface { Saves() <-chan Save Invalidations() <-chan Invalidation }
EventProducer will produce cache update and invalidation events on its channels
type Invalidation ¶
type Invalidation struct { Requests []string `json:"requests"` Imps []string `json:"imps"` Accounts []string `json:"accounts"` Responses []string `json:"responses"` }
Invalidation represents a bulk invalidation
type Save ¶
type Save struct { Requests map[string]json.RawMessage `json:"requests"` Imps map[string]json.RawMessage `json:"imps"` Accounts map[string]json.RawMessage `json:"accounts"` Responses map[string]json.RawMessage `json:"responses"` }
Save represents a bulk save
Click to show internal directories.
Click to hide internal directories.