kafkabackend

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FlushTimeout = 5000

FlushTimeout is the timeout we give to our kafka producer to flush pending messages.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend notifies about a job completion by producing to a Kafka topic.

func (*Backend) DeliveryReports

func (b *Backend) DeliveryReports() <-chan job.Callback

DeliveryReports returns a channel of emmited callback events

func (*Backend) ID

func (b *Backend) ID() string

ID returns "kafka".

func (*Backend) Notify

func (b *Backend) Notify(topic string, cbInfo job.Callback) error

Notify produces a Kafka message to topic.

func (*Backend) Start

func (b *Backend) Start(ctx context.Context, cfg map[string]interface{}) error

Start starts the backend by creating a producer, given a set of options provided by the configuration.

func (*Backend) Stop

func (b *Backend) Stop() error

Stop gracefully terminates b after flushing any outstanding messages to Kafka. An error is returned if (and only if) not all messages were flushed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳