mediabus-0.4.0.0: Multimedia streaming on top of Conduit

Safe HaskellNone
LanguageHaskell2010

Data.MediaBus.Conduit.Async

Description

Asynchronous execution of conduits. This module contains a set of functions to concurrently execute Stream processing conduits and couple them using TBQueues.

Synopsis

Documentation

withAsyncPolledSource :: (MonadResource m, MonadLogger m, MonadBaseControl IO m, KnownRate r, Integral t, Integral s, Default p, HasStaticDuration c, HasDuration c, NFData c, NFData p, NFData s, NFData t, Random i, Random t, Random s, Show c) => Int -> Source m (Stream i s (Ticks r t) p c) -> ((Async (), Source m (Stream i s (Ticks r t) p (Discontinous c))) -> m o) -> m o Source #

Asynchronously run a Source connected to a FrameContentQ and create a new source that consumes the queue by polling periodically from that queue, generating a Discontinous output.

data FrameContentQ a Source #

A queue for frameContent to decouple concurrent conduits carrying Streams. Under the hood a TBQueue is used. A queue also knows it's default segment duration and preferred polling interval.

mkFrameContentQ :: forall m a. (HasStaticDuration a, MonadBaseControl IO m) => Int -> m (FrameContentQ a) Source #

Create a new FrameContentQ with an upper bound on the queue length.

frameContentQSink :: (NFData a, MonadBaseControl IO m, Show a, MonadLogger m) => FrameContentQ a -> Sink (Stream i s t p a) m () Source #

Consume the frameContents of a Stream and write them into a FrameContentQ. When the queue is full, **drop the oldest element** and push in the new element, anyway.

frameContentQSource :: (Random i, NFData c, NFData p, Default p, HasStaticDuration c, HasDuration c, MonadBaseControl IO m, MonadLogger m, KnownRate r, Integral t, Integral s, NFData t, NFData s) => FrameContentQ c -> Source m (Stream i s (Ticks r t) p (Discontinous c)) Source #

Periodically poll a FrameContentQ and yield the content as frames with newly generated timestamp and sequence number values.