Skip to content

Commit b38c5a9

Browse files
committed
--wip-- [skip ci]
1 parent 56d78a2 commit b38c5a9

File tree

2 files changed

+2
-51
lines changed

2 files changed

+2
-51
lines changed

src/Kafka/Internal/RdKafka.chs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,24 +1215,6 @@ rdKafkaCreateTopic kafkaPtr topic opts queue = do
12151215
withForeignPtrsArrayLen topics $ \tLen tPtr -> do
12161216
{#call rd_kafka_CreateTopics#} kPtr tPtr (fromIntegral tLen) oPtr qPtr
12171217

1218-
rdKafkaEventCreateTopicsResult :: RdKafkaEventTPtr -> IO (Maybe RdKafkaTopicResultTPtr)
1219-
rdKafkaEventCreateTopicsResult evtPtr =
1220-
withForeignPtr evtPtr $ \evtPtr' -> do
1221-
res <- {#call rd_kafka_event_CreateTopics_result#} (castPtr evtPtr')
1222-
if (res == nullPtr)
1223-
then pure Nothing
1224-
else Just <$> newForeignPtr_ (castPtr res)
1225-
1226-
rdKafkaCreateTopicsResultTopics :: RdKafkaTopicResultTPtr
1227-
-> IO [Either (String, RdKafkaRespErrT, String) String]
1228-
rdKafkaCreateTopicsResultTopics tRes =
1229-
withForeignPtr tRes $ \tRes' ->
1230-
alloca $ \sPtr -> do
1231-
res <- {#call rd_kafka_CreateTopics_result_topics#} (castPtr tRes') sPtr
1232-
size <- peekIntConv sPtr
1233-
array <- peekArray size res
1234-
traverse unpackRdKafkaTopicResult array
1235-
12361218
--- Delete topic
12371219
foreign import ccall unsafe "rdkafka.h &rd_kafka_DeleteTopic_destroy"
12381220
rdKafkaDeleteTopicDestroy :: FinalizerPtr RdKafkaDeleteTopicT
@@ -1251,25 +1233,6 @@ newRdKafkaDeleteTopic topicNameStr =
12511233
then return $ Left $ "Something went wrong while deleting topic " ++ topicNameStr
12521234
else Right <$> newForeignPtr rdKafkaDeleteTopicDestroy res
12531235

1254-
rdKafkaEventDeleteTopicResult :: RdKafkaEventTPtr
1255-
-> IO (Maybe RdKafkaDeleteTopicResultTPtr)
1256-
rdKafkaEventDeleteTopicResult eventPtr =
1257-
withForeignPtr eventPtr $ \eventPtr' -> do
1258-
res <- {#call rd_kafka_event_DeleteTopics_result#} (castPtr eventPtr')
1259-
if (res == nullPtr)
1260-
then pure Nothing
1261-
else Just <$> newForeignPtr_ (castPtr res)
1262-
1263-
rdKafkaDeleteTopicResultTopic :: RdKafkaDeleteTopicResultTPtr
1264-
-> IO [Either (String, RdKafkaRespErrT, String) String]
1265-
rdKafkaDeleteTopicResultTopic topicResult =
1266-
withForeignPtr topicResult $ \topicResult' ->
1267-
alloca $ \sPtr -> do
1268-
res <- {#call rd_kafka_DeleteTopics_result_topics#} (castPtr topicResult') sPtr
1269-
size <- peekIntConv sPtr
1270-
arr <- peekArray size res
1271-
traverse unpackRdKafkaTopicResult arr
1272-
12731236
rdKafkaDeleteTopics :: RdKafkaTPtr
12741237
-> [RdKafkaDeleteTopicTPtr]
12751238
-> RdKafkaAdminOptionsTPtr
@@ -1280,17 +1243,6 @@ rdKafkaDeleteTopics kafkaPtr topics opts queue = do
12801243
withForeignPtrsArrayLen topics $ \tLen tPtr -> do
12811244
{#call rd_kafka_DeleteTopics#} kPtr tPtr (fromIntegral tLen) oPtr qPtr
12821245

1283-
unpackRdKafkaTopicResult :: Ptr RdKafkaTopicResultT
1284-
-> IO (Either (String, RdKafkaRespErrT, String) String)
1285-
unpackRdKafkaTopicResult resPtr = do
1286-
name <- {#call rd_kafka_topic_result_name#} resPtr >>= peekCString
1287-
err <- {#call rd_kafka_topic_result_error#} resPtr
1288-
case cIntToEnum err of
1289-
respErr -> do
1290-
errMsg <- {#call rd_kafka_topic_result_error_string#} resPtr >>= peekCString
1291-
pure $ Left (name, respErr, errMsg)
1292-
RdKafkaRespErrNoError -> pure $ Right name
1293-
12941246
-- Marshall / Unmarshall
12951247
enumToCInt :: Enum a => a -> CInt
12961248
enumToCInt = fromIntegral . fromEnum

tests-it/Kafka/IntegrationSpec.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@ spec = do
178178
let topicName = addRandomChars "admin.topic.created." 5
179179

180180
topicsMVar <- runIO newEmptyMVar
181-
{- specWithAdmin "Create topic" $ do
181+
182+
specWithAdmin "Create topic" $ do
182183

183184
it "should create a new topic" $ \(admin :: KAdmin) -> do
184185
tName <- topicName
185186
let newTopic = mkNewTopic (TopicName ( T.pack(tName) ))
186187
result <- createTopic admin newTopic
187188
result `shouldSatisfy` isRight
188189

189-
-}
190190
specWithConsumer "Read all topics" consumerProps $ do
191191

192192
it "should return all the topics" $ \(consumer :: KafkaConsumer) -> do
@@ -214,7 +214,6 @@ spec = do
214214

215215
it "should delete all the topics currently existing" $ \(admin ::KAdmin) -> do
216216
topics <- takeMVar topicsMVar
217-
putStrLn "Will now delete the topics"
218217
forM_ topics $ \topic -> do
219218
result <- deleteTopic admin topic
220219
result `shouldSatisfy` isRight

0 commit comments

Comments
 (0)