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.

  1. Metric'Sum :: Sum -> Metric'Data

    hs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics

    No documentation available.

  2. Metric'Summary :: Summary -> Metric'Data

    hs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics

    No documentation available.

  3. _Metric'Sum :: Prism' Metric'Data Sum

    hs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics

    No documentation available.

  4. _Metric'Summary :: Prism' Metric'Data Summary

    hs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics

    No documentation available.

  5. maybe'sum :: (Functor f, HasField s "maybe'sum" a) => LensLike' f s a

    hs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics_Fields

    No documentation available.

  6. maybe'summary :: (Functor f, HasField s "maybe'summary" a) => LensLike' f s a

    hs-opentelemetry-otlp Proto.Opentelemetry.Proto.Metrics.V1.Metrics_Fields

    No documentation available.

  7. Span'SPAN_KIND_CONSUMER :: Span'SpanKind

    hs-opentelemetry-otlp Proto.Opentelemetry.Proto.Trace.V1.Trace

    No documentation available.

  8. Consumer :: SpanKind

    hs-opentelemetry-sdk OpenTelemetry.Trace

    Indicates that the span describes the child of an asynchronous Producer request.

  9. leavesUnconsumed :: forall (p :: Type -> Type -> Type) s s' r a . (Source p s s' r, Leftover r s) => r a -> s -> Expectation

    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"
    

  10. module Kafka.Consumer

    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 ()
    

Page 214 of many | Previous | Next