monky-2.1.0.0: A system state collecting library and application

PortabilityLinux
Stabilitytesting
Maintainerongy
Safe HaskellNone

Monky.Outputs.Serialize

Description

This output can be used to transport monky-output over the network.

A simple receiver looks like:


import Monky.Modules
import Monky.Outputs.Dzen2

import qualified Data.ByteString.Lazy as BS
import Data.Serialize.Get
import Data.Serialize

printLine out bs = do
  let (Right (line, xs)) = runGetLazyState get bs
  doLine out line
  printLine out xs

main :: IO ()
main = do
  out <- getDzenOut 20 /home/ongy/.monky/xbm
  input <- BS.getContents
  printLine out input

Used with:

socat - TCP4:127.0.0.1:1234 | ./TestS| dzen2 -y 20 -w 1280
socat TCP-LISTEN:1234 EXEC:monky -d /tmp/monky

Synopsis

Documentation

getSerializeOut :: IO SerializeOutputSource

Get an output handle for show formatting

data SerializeOutput Source

The output handle for using show instance

Constructors

SerializeOutput