Hoogle Search
Within LTS Haskell 24.50 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
Metric'Sum :: Sum -> Metric'Datahs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics No documentation available.
Metric'Summary :: Summary -> Metric'Datahs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics No documentation available.
_Metric'Sum :: Prism' Metric'Data Sumhs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics No documentation available.
_Metric'Summary :: Prism' Metric'Data Summaryhs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics No documentation available.
maybe'sum :: (Functor f, HasField s "maybe'sum" a) => LensLike' f s ahs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics_Fields No documentation available.
maybe'summary :: (Functor f, HasField s "maybe'summary" a) => LensLike' f s ahs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics_Fields No documentation available.
Span'SPAN_KIND_CONSUMER :: Span'SpanKindhs-opentelemetry-otlp Proto.Opentelemetry.Proto.Trace.V1.Trace No documentation available.
-
hs-opentelemetry-sdk OpenTelemetry.Trace Indicates that the span describes the child of an asynchronous Producer request.
-
hspec-attoparsec Test.Hspec.Attoparsec Checking that the given parser succeeds and yields the given part of the input unconsumed. Intended to be used in conjunction with ~?>
("xa" :: Text) ~?> char 'x' `leavesUnconsumed` "a" -
Module to consume messages from Kafka topics. Here's an example of code to consume messages from a topic:
import Control.Exception (bracket) import Control.Monad (replicateM_) import Kafka.Consumer -- Global consumer properties consumerProps :: ConsumerProperties consumerProps = brokersList ["localhost:9092"] <> groupId (ConsumerGroupId "consumer_example_group") <> noAutoCommit <> logLevel KafkaLogInfo -- Subscription to topics consumerSub :: Subscription consumerSub = topics [TopicName "kafka-client-example-topic"] <> offsetReset Earliest -- Running an example runConsumerExample :: IO () runConsumerExample = do res <- bracket mkConsumer clConsumer runHandler print res where mkConsumer = newConsumer consumerProps consumerSub clConsumer (Left err) = pure (Left err) clConsumer (Right kc) = (maybe (Right ()) Left) <$> closeConsumer kc runHandler (Left err) = pure (Left err) runHandler (Right kc) = processMessages kc -- Example polling 10 times before stopping processMessages :: KafkaConsumer -> IO (Either KafkaError ()) processMessages kafka = do replicateM_ 10 $ do msg <- pollMessage kafka (Timeout 1000) putStrLn $ "Message: " <> show msg err <- commitAllOffsets OffsetCommit kafka putStrLn $ "Offsets: " <> maybe "Committed." show err pure $ Right ()