marconi-core-1.2.0.0: Modular indexing for rewindable ledger
Safe HaskellSafe-Inferred
LanguageHaskell2010

Marconi.Core.Transformer.WithStream.Streamable

Synopsis

Documentation

class Streamable a r where #

Something that can have mapped events streamed to or from it

Methods

streamFrom :: a -> Stream (Of r) IO () #

streamTo :: (Timed (Point event) event -> r) -> a -> Timed (Point event) event -> IO () #

Instances

Instances details
Binary r => Streamable Socket r #

A streaming implementation using Socket. For an example of how to use it, please see: testMarconi.CoreSpec.hspropWithStreamSocket

Instance details

Defined in Marconi.Core.Transformer.WithStream.Streamable

Methods

streamFrom :: Socket -> Stream (Of r) IO () #

streamTo :: (Timed (Point event) event -> r) -> Socket -> Timed (Point event) event -> IO () #

Streamable (TBQueue r) r #

An experimental streaming implementation using TBQueue.

IMPORTANT: Note that this will block when used with withStream if you have slow or non-existent consumers!

For an example of how to use it, please see: testMarconi.CoreSpec.hspropWithStreamTBQueue

Instance details

Defined in Marconi.Core.Transformer.WithStream.Streamable

Methods

streamFrom :: TBQueue r -> Stream (Of r) IO () #

streamTo :: (Timed (Point event) event -> r) -> TBQueue r -> Timed (Point event) event -> IO () #