batcher

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSchemaMessageBatch

type EventSchemaMessageBatch struct {
	Index   int
	Message *proto.EventSchemaMessage
	Jobs    []*jobsdb.JobT
}

A batch of jobs that share the same schema.

type EventSchemaMessageBatcher

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

EventSchemaMessageBatcher batches jobs by their schema.

func NewEventSchemaMessageBatcher

func NewEventSchemaMessageBatcher(transformer transformer.Transformer) *EventSchemaMessageBatcher

NewEventSchemaMessageBatcher creates a new batcher.

func (*EventSchemaMessageBatcher) Add

Add adds a job to the batcher after transforming it to an [EventSchemaMessage]. If the message is already in the batcher, the two messages will be merged to one.

func (*EventSchemaMessageBatcher) GetMessageBatches

func (sb *EventSchemaMessageBatcher) GetMessageBatches() []*EventSchemaMessageBatch

GetMessageBatches returns the message batches in the order they were added.

Jump to

Keyboard shortcuts

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