Nomyx-Language-0.7.1: Language to express rules for Nomic

Safe HaskellNone
LanguageHaskell98

Language.Nomyx.Events

Description

All the building blocks to allow rules to build events.

Synopsis

Documentation

onEvent :: (Typeable e, Show e) => Event e -> ((EventNumber, e) -> Nomex ()) -> Nomex EventNumber Source

register a callback on an event

onEvent_ :: (Typeable e, Show e) => Event e -> (e -> Nomex ()) -> Nomex EventNumber Source

register a callback on an event, disregard the event number

onEventOnce :: (Typeable e, Show e) => Event e -> (e -> Nomex ()) -> Nomex EventNumber Source

set an handler for an event that will be triggered only once

sendMessage :: (Typeable a, Show a) => Msg a -> a -> Nomex () Source

broadcast a message that can be catched by another rule

onMessage :: (Typeable m, Show m) => Msg m -> (m -> Nomex ()) -> Nomex EventNumber Source

subscribe on a message

onMessageOnce :: (Typeable m, Show m) => Msg m -> (m -> Nomex ()) -> Nomex EventNumber Source

schedule :: Schedule Freq -> (UTCTime -> Nomex ()) -> Nomex () Source

on the provided schedule, the supplied function will be called

schedule' :: [UTCTime] -> (UTCTime -> Nomex ()) -> Nomex () Source