groupmember

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 10 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 maintains a consumer group member registration in ZooKeeper, watches for other members to join, leave and update their subscriptions, and generates notifications of such changes.

func Spawn

func Spawn(namespace *actor.ID, group, memberID string, cfg *config.T, kazooConn *kazoo.Kazoo) *T

Spawn creates a consumer group member instance and starts its background goroutines.

func (*T) ClaimPartition

func (gm *T) ClaimPartition(claimerActorID *actor.ID, 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 (gm *T) Stop()

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

func (*T) Subscriptions

func (gm *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 (gm *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