subscriber

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

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

T is a subscriber implementation based on ZooKeeper. It maintains consumer group membership and topic subscriptions, watches for other members to join, leave and update their subscriptions, and generates notifications of such changes. It also provides an API to for a partition consumer to claim and release a group-topic-partition.

func Spawn

func Spawn(parentActDesc *actor.Descriptor, group string, cfg *config.Proxy, kazooClt *kazoo.Kazoo) *T

Spawn creates a subscriber instance and starts its goroutine.

func (*T) ClaimPartition

func (ss *T) ClaimPartition(claimerActDesc *actor.Descriptor, topic string, partition int32, cancelCh <-chan none.T) func()

ClaimPartition claims a topic/partition to be consumed by this member of the consumer group. It blocks until either succeeds or canceled by the caller. It returns a function that should be called to release the claim.

func (*T) Stop

func (ss *T) Stop()

Stop signals the consumer group member to stop and blocks until its goroutines are over.

func (*T) Subscriptions

func (ss *T) Subscriptions() <-chan map[string][]string

Subscriptions returns a channel that subscriptions will be sent whenever a member joins or leaves the group or when an existing member updates its subscription.

func (*T) Topics

func (ss *T) Topics() chan<- []string

Topics returns a channel to receive a list of topics the member should subscribe to. To make the member unsubscribe from all topics either nil or an empty topic list can be sent.

Jump to

Keyboard shortcuts

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