Header menu logo Nu

EventGraph Module

Types

Type Description

EventGraph

A functional publisher-neutral mechanism for handling simulation events in Nu. Publisher-neutrality means that the user can subscribe to events regardless if the event source exists or not. This decouples subscription lifetime from event source lifetime.

Functions and values

Function or value Description

EventGraph.addEventState key state eventGraph

Full Usage: EventGraph.addEventState key state eventGraph

Parameters:
Returns: EventGraph

Add event state.

key : uint64
state : 'a
eventGraph : EventGraph
Returns: EventGraph

EventGraph.cleanEventAddressCache eventTarget

Full Usage: EventGraph.cleanEventAddressCache eventTarget

Parameters:

Remove from the event address cache all addresses belonging to the given target.

eventTarget : 'a Address

EventGraph.getEventAddresses1 eventAddress

Full Usage: EventGraph.getEventAddresses1 eventAddress

Parameters:
Returns: 'a Address array
eventAddress : 'a Address
Returns: 'a Address array

EventGraph.getEventAddresses2 eventAddress arg2

Full Usage: EventGraph.getEventAddresses2 eventAddress arg2

Parameters:
Returns: 'a Address array

Get the wild-carded addresses of an event address.

eventAddress : 'a Address
arg1 : EventGraph
Returns: 'a Address array

EventGraph.getEventFilter eventGraph

Full Usage: EventGraph.getEventFilter eventGraph

Parameters:
Returns: EventFilter

Get the state of the event filter.

eventGraph : EventGraph
Returns: EventFilter

EventGraph.getEventState key eventGraph

Full Usage: EventGraph.getEventState key eventGraph

Parameters:
Returns: 'a

Get event state.

key : uint64
eventGraph : EventGraph
Returns: 'a

EventGraph.getEventTracerOpt eventGraph

Full Usage: EventGraph.getEventTracerOpt eventGraph

Parameters:
Returns: (string -> unit) option

Get how events are being traced.

eventGraph : EventGraph
Returns: (string -> unit) option

EventGraph.getGlobalSimulantGeneralized eventGraph

Full Usage: EventGraph.getGlobalSimulantGeneralized eventGraph

Parameters:
Returns: GlobalSimulantGeneralized

Get the generalized global simulant of the event system.

eventGraph : EventGraph
Returns: GlobalSimulantGeneralized

EventGraph.getSortableSubscriptions getSortPriority subscriptionEntries world

Full Usage: EventGraph.getSortableSubscriptions getSortPriority subscriptionEntries world

Parameters:
Returns: (IComparable * uint64 * SubscriptionEntry) seq

Get the subscriptions with the given sorting criteria.

getSortPriority : Simulant -> 'w -> IComparable
subscriptionEntries : (uint64 * SubscriptionEntry) seq
world : 'w
Returns: (IComparable * uint64 * SubscriptionEntry) seq

EventGraph.getSubscriptions eventGraph

Full Usage: EventGraph.getSubscriptions eventGraph

Parameters:
Returns: SubscriptionEntries

Get subscriptions.

eventGraph : EventGraph
Returns: SubscriptionEntries

EventGraph.getSubscriptionsSorted publishSorter eventAddress eventGraph world

Full Usage: EventGraph.getSubscriptionsSorted publishSorter eventAddress eventGraph world

Parameters:
Returns: (uint64 * SubscriptionEntry) seq

Get subscriptions for eventAddress sorted by publishSorter.

publishSorter : SubscriptionSorter
eventAddress : obj Address
eventGraph : EventGraph
world : 'w
Returns: (uint64 * SubscriptionEntry) seq

EventGraph.getUnsubscriptions eventGraph

Full Usage: EventGraph.getUnsubscriptions eventGraph

Parameters:
Returns: UnsubscriptionEntries

Get unsubscriptions.

eventGraph : EventGraph
Returns: UnsubscriptionEntries

EventGraph.logEvent address trace eventGraph

Full Usage: EventGraph.logEvent address trace eventGraph

Parameters:

Log an event.

address : obj Address
trace : EventTrace
eventGraph : EventGraph

EventGraph.make eventTracerOpt eventFilter globalSimulantGeneralized config

Full Usage: EventGraph.make eventTracerOpt eventFilter globalSimulantGeneralized config

Parameters:
Returns: EventGraph

Make an event delegate.

eventTracerOpt : (string -> unit) option
eventFilter : EventFilter
globalSimulantGeneralized : GlobalSimulantGeneralized
config : TConfig
Returns: EventGraph

EventGraph.publishEvent subscriber publisher eventData eventAddress eventTrace subscription world

Full Usage: EventGraph.publishEvent subscriber publisher eventData eventAddress eventTrace subscription world

Parameters:
    subscriber : Simulant
    publisher : 'p
    eventData : obj
    eventAddress : 'a Address
    eventTrace : EventTrace
    subscription : obj
    world : 'w

Returns: Handling
Modifiers: inline
Type parameters: 'a, 'p, 's, 'w

Publish an event.

subscriber : Simulant
publisher : 'p
eventData : obj
eventAddress : 'a Address
eventTrace : EventTrace
subscription : obj
world : 'w
Returns: Handling

EventGraph.removeEventState key eventGraph

Full Usage: EventGraph.removeEventState key eventGraph

Parameters:
Returns: EventGraph

Remove event state.

key : uint64
eventGraph : EventGraph
Returns: EventGraph

EventGraph.setEventFilter filter eventGraph

Full Usage: EventGraph.setEventFilter filter eventGraph

Parameters:
Returns: EventGraph

Set the state of the event filter.

filter : EventFilter
eventGraph : EventGraph
Returns: EventGraph

EventGraph.setEventTracerOpt tracing eventGraph

Full Usage: EventGraph.setEventTracerOpt tracing eventGraph

Parameters:
    tracing : (string -> unit) option
    eventGraph : EventGraph

Returns: EventGraph

Set how events are being traced.

tracing : (string -> unit) option
eventGraph : EventGraph
Returns: EventGraph

EventGraph.sortSubscriptionsBy by subscriptions world

Full Usage: EventGraph.sortSubscriptionsBy by subscriptions world

Parameters:
Returns: (uint64 * SubscriptionEntry) seq

Sort subscriptions using categorization via the 'by' procedure.

by : Simulant -> 'w -> IComparable
subscriptions : (uint64 * SubscriptionEntry) seq
world : 'w
Returns: (uint64 * SubscriptionEntry) seq

EventGraph.sortSubscriptionsNone subscriptions arg2

Full Usage: EventGraph.sortSubscriptionsNone subscriptions arg2

Parameters:
Returns: SubscriptionEntry array

A 'no-op' for subscription sorting - that is, performs no sorting at all.

subscriptions : SubscriptionEntry array
arg1 : 'w
Returns: SubscriptionEntry array

Type something to start searching.