{-# LANGUAGE DeriveDataTypeable #-}
module Kafka.Producer.Types
where
import qualified Data.ByteString as BS
import Data.Typeable
import Kafka.Types
import Kafka.Internal.RdKafka
data KafkaProducer = KafkaProducer
{ kpKafkaPtr :: RdKafkaTPtr
, kpKafkaConf :: RdKafkaConfTPtr
, kpTopicConf :: RdKafkaTopicConfTPtr
} deriving (Show)
data ProducerRecord = ProducerRecord
{ prTopic :: !TopicName
, prPartition :: !ProducePartition
, prKey :: Maybe BS.ByteString
, prValue :: Maybe BS.ByteString
} deriving (Eq, Show, Typeable)
data ProducePartition =
SpecifiedPartition {-# UNPACK #-} !Int
| UnassignedPartition
deriving (Show, Eq, Ord, Typeable)