Class: EventBuffer

olympe.dc.db. EventBuffer

An event buffer is used by the database to buffer events happening to the database while a transaction is processed. It aggregates the events to avoid triggering obsolete events at the end of a transaction.


new EventBuffer(database, context)

Parameters:
Name Type Description
database olympe.dc.db.Database
context olympe.df.ExecutionContext

Methods


<package> addCallback(id, callback)

Parameters:
Name Type Description
id string
callback function

<package> commitAndClear()

Loop over all buffered events, process the callbacks related to them and clear the buffer at the end.


<package> dispatchPropertyEvent(tag, property, value, isDefault)

Parameters:
Name Type Argument Description
tag string
property string
value * <nullable>
isDefault boolean

<package> dispatchRelationEvent(tag, relation, direction, relatedTag, added)

Parameters:
Name Type Description
tag string
relation string
direction string
relatedTag string
added boolean

<package> isDeleteEvent(tag)

Return true if the event associated to tag is a delete event

Parameters:
Name Type Description
tag string
Returns:
Type
boolean

<package> removeCallback(id)

Parameters:
Name Type Description
id string

<package> setExistence(tag, exist)

Parameters:
Name Type Description
tag string
exist boolean