package queue

import "time"

// QueueConsumer queue consumer interface
// for a message queue consumer implements
type QueueConsumer interface {
	// GetTopic get current topic
	GetTopic() string
	// Subscribe ，subscribe the topic
	Subscribe() error
	// SubscribeWithPartitions subscribe with partitions, partitions is topics
	SubscribeWithPartitions(partitions []*TopicPartitionInfo) error
	// UnSubscribe unsubscribe
	UnSubscribe()
	// Pop ，pop message from queue with time duration
	Pop(time time.Duration) (<-chan QueueMessage, error)
	// Commit ，commit a message to queue if it is necessary
	Commit() error
}
