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 # 
Instance details

Defined in Network.UI.Kafka

Read TopicConnection Source # 
Instance details

Defined in Network.UI.Kafka

Show TopicConnection Source # 
Instance details

Defined in Network.UI.Kafka

Generic TopicConnection Source # 
Instance details

Defined in Network.UI.Kafka

Associated Types

type Rep TopicConnection :: Type -> Type #

ToJSON TopicConnection Source # 
Instance details

Defined in Network.UI.Kafka

FromJSON TopicConnection Source # 
Instance details

Defined in Network.UI.Kafka

type Rep TopicConnection Source # 
Instance details

Defined in Network.UI.Kafka

type Rep TopicConnection = D1 (MetaData "TopicConnection" "Network.UI.Kafka" "kafka-device-1.0.0.0-EqsHhyPPoUkHjkzPUXhYxI" False) (C1 (MetaCons "TopicConnection" PrefixI True) (S1 (MetaSel (Just "client") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "address") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (String, Int)) :*: S1 (MetaSel (Just "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.