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

Safe HaskellNone

Language.Nomyx.Events

Contents

Description

All the building blocks to allow rules to build events.

Synopsis

Events

onEvent :: (Typeable e, Show e, Eq e) => Event e -> ((EventNumber, EventData e) -> Nomex ()) -> Nomex EventNumberSource

register a callback on an event

onEvent_ :: forall e. (Typeable e, Show e, Eq e) => Event e -> (EventData e -> Nomex ()) -> Nomex ()Source

register a callback on an event, disregard the event number

onEventOnce :: (Typeable e, Show e, Eq e) => Event e -> (EventData e -> Nomex ()) -> Nomex EventNumberSource

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

onEventOnce_ :: (Typeable e, Show e, Eq e) => Event e -> (EventData e -> Nomex ()) -> Nomex ()Source

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

delAllEvents :: (Typeable e, Show e, Eq e) => Event e -> Nomex ()Source

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

broadcast a message that can be catched by another rule

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

subscribe on a message

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

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

on the provided schedule, the supplied function will be called

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