consumer_group_instance.go 686 B

1234567891011121314151617181920212223
  1. package sub_coordinator
  2. import (
  3. "github.com/seaweedfs/seaweedfs/weed/mq/topic"
  4. "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
  5. )
  6. type ConsumerGroupInstanceId string
  7. type ConsumerGroupInstance struct {
  8. InstanceId ConsumerGroupInstanceId
  9. AssignedPartitions []topic.Partition
  10. ResponseChan chan *mq_pb.SubscriberToSubCoordinatorResponse
  11. MaxPartitionCount int32
  12. }
  13. func NewConsumerGroupInstance(instanceId string, maxPartitionCount int32) *ConsumerGroupInstance {
  14. return &ConsumerGroupInstance{
  15. InstanceId: ConsumerGroupInstanceId(instanceId),
  16. ResponseChan: make(chan *mq_pb.SubscriberToSubCoordinatorResponse, 1),
  17. MaxPartitionCount: maxPartitionCount,
  18. }
  19. }