Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocationMode ¶
type AllocationMode string
const ( AllocationModePool AllocationMode = "pool" AllocationModeStatic AllocationMode = "static" )
type PooledWorkerAllocator ¶
type PooledWorkerAllocator struct {
// contains filtered or unexported fields
}
PooledWorkerAllocator holds a shared pool of workers for all partitions to use. cannot guarantee that single worker will always be used to handle the same partition but offers the best throughput since all partitions of a given topic share the same pool of workers
func (*PooledWorkerAllocator) AllocateWorker ¶
func (*PooledWorkerAllocator) ReleaseWorker ¶
func (wa *PooledWorkerAllocator) ReleaseWorker(cookie interface{}, workerInstance *worker.Worker) error
func (*PooledWorkerAllocator) Stop ¶
func (wa *PooledWorkerAllocator) Stop() error
type StaticWorkerAllocator ¶
type StaticWorkerAllocator struct {
// contains filtered or unexported fields
}
StaticWorkerAllocator statically maps a given partition to a given worker. this guarantees that a given partition in a given topic will *always* be handled by the same worker of this replica. for functions that benefit from holding in-order state this will be useful. however, the cost is throughput - it segments the worker pool such that it's possible that a partition mapped to a busy worker will wait processing an event even though there are free workers (which are mapped to other partitions)
func (*StaticWorkerAllocator) AllocateWorker ¶
func (*StaticWorkerAllocator) ReleaseWorker ¶
func (wa *StaticWorkerAllocator) ReleaseWorker(cookie interface{}, workerInstance *worker.Worker) error
func (*StaticWorkerAllocator) Stop ¶
func (wa *StaticWorkerAllocator) Stop() error