Documentation ¶
Index ¶
- Variables
- type Callback
- type Config
- type EventCallback
- type Processor
- func (f *Processor) Clear()
- func (f *Processor) Enqueue(peer string, events dag.Events, ordered bool, ...) error
- func (f *Processor) IsBuffered(id hash.Event) bool
- func (f *Processor) Overloaded() bool
- func (f *Processor) Start()
- func (f *Processor) Stop()
- func (f *Processor) TasksCount() int
- func (f *Processor) TotalBuffered() dag.Metric
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBusy = errors.New("failed to acquire events semaphore")
)
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback struct { Event EventCallback HighestLamport func() idx.Lamport }
type Config ¶
type Config struct { EventsBufferLimit dag.Metric EventsSemaphoreTimeout time.Duration MaxTasks int }
func DefaultConfig ¶
func DefaultConfig(scale cachescale.Func) Config
type EventCallback ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is responsible for processing incoming events
func New ¶
func New(eventsSemaphore *datasemaphore.DataSemaphore, cfg Config, callback Callback) *Processor
New creates an event processor
func (*Processor) Overloaded ¶
Overloaded returns true if too much events are being processed or requested
func (*Processor) Stop ¶
func (f *Processor) Stop()
Stop interrupts the processor, canceling all the pending operations. Stop waits until all the internal goroutines have finished.
func (*Processor) TasksCount ¶
func (*Processor) TotalBuffered ¶
Click to show internal directories.
Click to hide internal directories.