blob: adcf0e9c1cffebe1b543e79bdc6a37b414c27b5e [file] [log] [blame]
Scott Bakere7144bc2019-10-01 14:16:47 -07001package cluster
2
3// Strategy for partition to consumer assignement
4type Strategy string
5
6const (
7 // StrategyRange is the default and assigns partition ranges to consumers.
8 // Example with six partitions and two consumers:
9 // C1: [0, 1, 2]
10 // C2: [3, 4, 5]
11 StrategyRange Strategy = "range"
12
13 // StrategyRoundRobin assigns partitions by alternating over consumers.
14 // Example with six partitions and two consumers:
15 // C1: [0, 2, 4]
16 // C2: [1, 3, 5]
17 StrategyRoundRobin Strategy = "roundrobin"
18)
19
20// Error instances are wrappers for internal errors with a context and
21// may be returned through the consumer's Errors() channel
22type Error struct {
23 Ctx string
24 error
25}