kafka-device-1.0.0.0: UI device events via a Kafka message broker

Copyright(c) 2016-19 Brian W Bush
LicenseMIT
MaintainerBrian W Bush <code@functionally.io>
StabilityProduction
PortabilityPortable
Safe HaskellNone
LanguageHaskell2010

Network.UI.Kafka

Contents

Description

Produce and consume events on Kafka topics.

Synopsis

Types

data TopicConnection Source #

Connection information for a Kafka topic.

Constructors

TopicConnection 

Fields

Instances

Eq TopicConnection Source # 
Read TopicConnection Source # 
Show TopicConnection Source # 
Generic TopicConnection Source # 
ToJSON TopicConnection Source # 
FromJSON TopicConnection Source # 
type Rep TopicConnection Source # 
type Rep TopicConnection = D1 * (MetaData "TopicConnection" "Network.UI.Kafka" "kafka-device-1.0.0.0-7U9qgkxLORxLpEJz1lnLpE" False) (C1 * (MetaCons "TopicConnection" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "client") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)) ((:*:) * (S1 * (MetaSel (Just Symbol "address") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (String, Int))) (S1 * (MetaSel (Just Symbol "topic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * String)))))

type Sensor = String Source #

A name for a sensor.

type LoopAction = IO (Either KafkaClientError ()) Source #

Action for iterating to produce or consume events.

type ExitAction = IO () Source #

Action for ending iteration.

Consumption

type ConsumerCallback Source #

Arguments

 = Sensor

The name of the sensor producing the event.

-> Event

The event.

-> IO ()

The action for consuming the event.

Callback for consuming events from a sensor.

consumerLoop Source #

Arguments

:: TopicConnection

The Kafka topic name and connection information.

-> ConsumerCallback

The consumer callback.

-> IO (ExitAction, LoopAction)

Action to create the exit and loop actions.

Consume events for a Kafka topic.

Production

type ProducerCallback Source #

Arguments

 = IO [Event]

Action for producing events.

Callback for producing events from a sensor.

producerLoop Source #

Arguments

:: TopicConnection

The Kafka topic name and connection information.

-> Sensor

The name of the sensor producing the event.

-> ProducerCallback

The producer callback.

-> IO (ExitAction, LoopAction)

Action to create the exit and loop actions.

Produce events for a Kafka topic.