package queue

import "time"

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