kafka-device-glut 0.1.3.0 → 0.2.1.2
raw patch · 3 files changed
+12/−20 lines, 3 filesdep −milenadep ~GLUTdep ~OpenGLdep ~kafka-device
Dependencies removed: milena
Dependency ranges changed: GLUT, OpenGL, kafka-device
Files
- kafka-device-glut.cabal +6/−8
- src/Main.hs +2/−4
- src/Network/UI/Kafka/GLUT.hs +4/−8
kafka-device-glut.cabal view
@@ -1,19 +1,19 @@ name: kafka-device-glut-version: 0.1.3.0+version: 0.2.1.2 synopsis: GLUT events via a Kafka message broker description: This package contains functions for passing GLUT events to topics on a Kafka message broker \<<https://kafka.apache.org/>\>. Also see \<<https://hackage.haskell.org/package/kafka-device/>\>. license: MIT license-file: LICENSE author: Brian W Bush <consult@brianwbush.info> maintainer: Brian W Bush <consult@brianwbush.info>-copyright: (c) 2016 Brian W Bush+copyright: (c) 2016-17 Brian W Bush category: Hardware build-type: Simple cabal-version: >= 1.10 stability: Experimental homepage: https://bitbucket.org/functionally/kafka-device-glut bug-reports: https://bwbush.atlassian.net/projects/HKAFDEV/issues/-package-url: https://bitbucket.org/functionally/kafka-device-glut/downloads/kafka-device-glut-0.1.3.0.tar.gz+package-url: https://bitbucket.org/functionally/kafka-device-glut/downloads/kafka-device-glut-$version.tar.gz extra-source-files: ReadMe.md @@ -24,10 +24,9 @@ library exposed-modules: Network.UI.Kafka.GLUT build-depends: base >= 4.8 && < 5- , GLUT- , kafka-device- , milena- , OpenGL+ , GLUT >= 2.7.0+ , kafka-device >= 0.2.1.2+ , OpenGL >= 3.0.0 hs-source-dirs: src ghc-options: -Wall default-language: Haskell2010@@ -37,7 +36,6 @@ build-depends: base , GLUT , kafka-device- , milena , OpenGL hs-source-dirs: src ghc-options: -Wall -threaded
src/Main.hs view
@@ -18,9 +18,9 @@ import Control.Concurrent (forkIO) import Control.Monad (void)-import Data.String (IsString(fromString)) import Graphics.Rendering.OpenGL (ClearBuffer(..), ($=!), clear) import Graphics.UI.GLUT (createWindow, displayCallback, getArgsAndInitialize, mainLoop, swapBuffers)+import Network.UI.Kafka (TopicConnection(TopicConnection)) import Network.UI.Kafka.GLUT (glutLoop) @@ -42,9 +42,7 @@ void $ createWindow "GLUT Events for Kafka" (_, loop) <- glutLoop- (fromString client)- (fromString host, toEnum $ read port)- (fromString topic)+ (TopicConnection client (host, read port) topic) sensor callbacks void . forkIO $ void loop
src/Network/UI/Kafka/GLUT.hs view
@@ -24,9 +24,7 @@ import Control.Monad (when) import Graphics.Rendering.OpenGL (($=!)) import Graphics.UI.GLUT as G (Key(..), KeyState(..), JoystickButtons(..), JoystickPosition(..), Modifiers(..), MouseButton(..), Position(..), SpaceballInput(..), SpecialKey(..), joystickCallback, keyboardMouseCallback, motionCallback, passiveMotionCallback, spaceballCallback)-import Network.Kafka (KafkaAddress, KafkaClientId)-import Network.Kafka.Protocol (TopicName)-import Network.UI.Kafka as K (ExitAction, LoopAction, Sensor, producerLoop)+import Network.UI.Kafka as K (ExitAction, LoopAction, Sensor, TopicConnection, producerLoop) import Network.UI.Kafka.Types as K (Event(..), Modifiers(..), Button(..), SpecialKey(..)) @@ -46,13 +44,11 @@ -- | Produce events for a Kafka topic from GLUT callbacks \<<https://hackage.haskell.org/package/GLUT-2.7.0.10/docs/Graphics-UI-GLUT-Callbacks-Window.html>\>.-glutLoop :: KafkaClientId -- ^ A Kafka client identifier for the producer.- -> KafkaAddress -- ^ The address of the Kakfa broker.- -> TopicName -- ^ The Kafka topic name.+glutLoop :: TopicConnection -- ^ The Kafka topic name and connection information. -> Sensor -- ^ The name of the sensor producing events. -> [GlutCallback] -- ^ Which callbacks to enable. -> IO (ExitAction, LoopAction) -- ^ Action to create the exit and loop actions.-glutLoop clientId address topic sensor callbacks =+glutLoop topicConnection sensor callbacks = do nextEvent <- newEmptyMVar mapM_@@ -65,7 +61,7 @@ , (Joystick , joystickCallback $=! Just ( (putMVar nextEvent .) . interpretJoystick , 0)) ] (exit, loop) <-- producerLoop clientId address topic sensor+ producerLoop topicConnection sensor $ (: []) <$> takeMVar nextEvent return