butler-0.0.1.0: At your service.
Safe HaskellSafe-Inferred
LanguageGHC2021

Butler.Display.Client

Description

This module contains the DisplayClient logic.

Synopsis

Display client

data DisplayClient #

A network client. Note that the sendThread must be running for the send* function to work.

Html output

sendHtml :: DisplayClient -> HtmlT STM () -> STM () #

Send Html to a client.

sendsHtml :: DisplayClients -> HtmlT STM () -> ProcessIO () #

Send Html to all clients.

sendsHtmlButSelf :: DisplayClient -> DisplayClients -> HtmlT STM () -> ProcessIO () #

Send Html to all clients except the provided one (self).

clientsDraw :: DisplayClients -> (DisplayClient -> ProcessIO (HtmlT STM ())) -> ProcessIO () #

Send html using a draw action.

Binary output

sendBinary :: DisplayClient -> LByteString -> STM () #

Send binary to a client.

sendsBinary :: DisplayClients -> LByteString -> ProcessIO () #

Send binary to all clients.

sendsBinaryButSelf :: DisplayClient -> DisplayClients -> LByteString -> ProcessIO () #

Send binary to all clients except the provided one (self).

Inputs

recvData :: MonadIO m => DisplayClient -> m DataMessage #

Low-level helper to read a DataMessage.

recvBinary :: MonadIO m => DisplayClient -> m ByteString #

Low-level helper to read a binary buffer.

Management thread

pingThread :: DisplayClient -> ProcessIO Void #

An action to keep a client alive.

sendThread :: DisplayClient -> ProcessIO Void #

An action to send data message.

Collection of clients

data DisplayClients #

A collection of clients.

Internal

newtype Endpoint #

Constructors

Endpoint Text 

Instances

Instances details
FromJSON Endpoint # 
Instance details

Defined in Butler.Display.Client

ToJSON Endpoint # 
Instance details

Defined in Butler.Display.Client

IsString Endpoint # 
Instance details

Defined in Butler.Display.Client

Show Endpoint # 
Instance details

Defined in Butler.Display.Client

Eq Endpoint # 
Instance details

Defined in Butler.Display.Client

Ord Endpoint # 
Instance details

Defined in Butler.Display.Client

ToHtml Endpoint # 
Instance details

Defined in Butler.Display.Client

Methods

toHtml :: forall (m :: Type -> Type). Monad m => Endpoint -> HtmlT m () #

toHtmlRaw :: forall (m :: Type -> Type). Monad m => Endpoint -> HtmlT m () #