RxHaskell-0.2: Reactive Extensions for Haskell

Safe HaskellSafe




data SchedulerIO s a whereSource

An IO computation that must be performed in a scheduler of type s.


SchedulerIO :: Scheduler s => (s -> IO a) -> SchedulerIO s a 


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 SchedulerIO action and shows the result. This is for DEBUGGING PURPOSES ONLY.

getCurrentScheduler :: Scheduler s => SchedulerIO s sSource

Returns the scheduler that the calling code is executing on.

class Scheduler s whereSource

Represents a queue of IO actions which can be executed in FIFO order.


schedule :: s -> SchedulerIO s () -> IO DisposableSource

Schedules an action on the scheduler. Returns a disposable which can be used to cancel it.

schedulerMain :: s -> IO ()Source

Executes all current and future actions enqueued on the given scheduler.

newtype BackgroundScheduler Source

A scheduler which runs enqueued actions in a dedicated background thread.

data ScheduledAction s Source

Represents an action on a scheduler, along with a flag indicating whether it should be canceled.

newScheduledAction :: Scheduler s => SchedulerIO s () -> IO (ScheduledAction s, Disposable)Source

Creates a new scheduled action, and returns a disposable which can be used to cancel it.

executeScheduledAction :: Scheduler s => s -> ScheduledAction s -> IO ()Source

Executes the given action, then re-enters schedulerMain.