Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
JoranVanBelle committed Dec 18, 2024
1 parent 95960ef commit e76d1d5
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/Kafka/Admin.hs
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
module Kafka.Admin where


import Control.Monad
import Control.Monad.IO.Class

import Kafka.Internal.RdKafka
import Kafka.Internal.Setup

import Kafka.Types
import Kafka.Admin.AdminProperties

data KAdmin = KAdmin {
adminKafka :: !Kafka
, adminKafkaConfig :: !KafkaConf
}

{-
-newKAdmin :: MonadIO m
newKAdmin :: MonadIO m
=> AdminProperties
-> m (Either KafkaError KafkaAdmin)
-
- -}
-> m (Either KafkaError KAdmin)
newKAdmin properties = liftIO $ do
kafkaConfig@(KafkaConf kafkaConf' _ _) <- kafkaConf ( KafkaProps $ adminProps properties)
maybeKafka <- newRdKafkaT RdKafkaProducer kafkaConf'
case maybeKafka of
Left err -> pure $ Left $ KafkaError err
Right kafka -> pure $ Right $ KAdmin (Kafka kafka) kafkaConfig

0 comments on commit e76d1d5

Please sign in to comment.