Safe Haskell | Safe |
---|
- data Connection s v
- multicast :: Scheduler s => Signal s v -> Channel s v -> IO (Connection s v)
- publish :: Scheduler s => Signal s v -> IO (Connection s v)
- connect :: forall s v. Scheduler s => Connection s v -> SchedulerIO s Disposable
- multicastedSignal :: Connection s v -> Signal s v
- replay :: Scheduler s => Signal s v -> SchedulerIO s (Signal s v)
- replayLast :: Scheduler s => Signal s v -> SchedulerIO s (Signal s v)
- type Channel s v = (Subscriber s v, Signal s v)
- data Signal s v
- class Scheduler s
- data SchedulerIO s a
- data Disposable
Documentation
data Connection s v Source
Multicasts a signal to many subscribers, without triggering any side effects more than once.
multicast :: Scheduler s => Signal s v -> Channel s v -> IO (Connection s v)Source
Creates a connection that will subscribe to the given base signal, and forward all events onto the given channel.
connect :: forall s v. Scheduler s => Connection s v -> SchedulerIO s DisposableSource
Activates a connection by subscribing to its underlying signal. Calling this function multiple times just returns the existing disposable.
multicastedSignal :: Connection s v -> Signal s vSource
Returns the multicasted signal of a connection.
No events will be sent on the resulting signal until connect
is invoked.
replay :: Scheduler s => Signal s v -> SchedulerIO s (Signal s v)Source
Multicasts to a replay channel of unlimited capacity, then connects immediately.
replayLast :: Scheduler s => Signal s v -> SchedulerIO s (Signal s v)Source
Multicasts to a replay channel of capacity 1, then connects immediately.
type Channel s v = (Subscriber s v, Signal s v)Source
A controllable signal, represented by a Subscriber
and Signal
pair.
Values sent to the subscriber will automatically be broadcast to all of the signal's subscribers. In effect, the subscriber is the write end, while the signal is the read end.
A signal which will send values of type v
on a scheduler of type s
.
Represents a queue of IO
actions which can be executed in FIFO order.
data SchedulerIO s a Source
An IO
computation that must be performed in a scheduler of type s
.
Scheduler s => Monad (SchedulerIO s) | |
Functor (SchedulerIO s) | |
Scheduler s => Applicative (SchedulerIO s) | |
Scheduler s => MonadIO (SchedulerIO s) | |
Show v => Show (SchedulerIO BackgroundScheduler v) | |
Show v => Show (SchedulerIO MainScheduler v) | Unsafely executes a |
data Disposable Source
Allows disposal of a resource by running an action in the monad m
.