network-transport-inmemory-0.5.1: In-memory instantiation of Network.Transport

Safe HaskellNone
LanguageHaskell98

Network.Transport.InMemory

Contents

Description

In-memory implementation of the Transport API.

Synopsis

Documentation

createTransport :: IO Transport Source

Create a new Transport.

Only a single transport should be created per Haskell process (threads can, and should, create their own endpoints though).

createTransportExposeInternals :: IO (Transport, TransportInternals) Source

Create a new Transport exposing internal state.

Useful for testing and/or debugging purposes. Should not be used in production. No guarantee as to the stability of the internals API.

For testing purposes

newtype TransportInternals Source

Constructors

TransportInternals (TVar TransportState) 

breakConnection Source

Arguments

:: TransportInternals 
-> EndPointAddress 
-> EndPointAddress 
-> String

Error message

-> IO () 

Function that simulate failing connection between two endpoints, after calling this function both endpoints will receive ConnectionEventLost message, and all LocalConnectionValid connections will be put into LocalConnectionFailed state.