Class: BurstTransaction

olympe.dc. BurstTransaction

Burst transactions are meant to be used when you expect to update one or more instance several times in quick sequences. For instance when moving a component on the screen. The main difference with standard transactions is that the operations are applied on the local data-cloud immediately while the remote data-cloud is updated after a delay and only with the latest values. It is mainly used for fluidity concerns, especially when there is no need to have all intermediary states of update in the persisted database. Example: Moving an element on the screen can generate 60 positions per second, but we only need to persist the final one.


new BurstTransaction( [id] [, parentContext])

Creates an instance of Burst transaction

Parameters:
Name Type Argument Description
id string <optional>

Option fast update identifier

parentContext olympe.df.ExecutionContext <optional>

the context to which attach the transaction

Methods


<static> getKey(instance, property)

Parameters:
Name Type Description
instance string
property string
Returns:
Type
string

commit( [callback])

The transaction will be committed (orchestrator side) and its reverse transaction will be stored in the stack. Commit should be called only for reversible transactions.

Parameters:
Name Type Argument Description
callback olympe.dc.Manager.TransactionCallback <optional>

the callback to run when the undo is completed


complete()

Complete and close the burst transaction.

Returns:
Type
Promise.<void>

getContext()

Returns:
Type
olympe.df.ExecutionContext

<package> getId()

Gets this Burst Transaction's identifier.

Returns:
Type
string

isReversible()

Check if the transaction can be used for undo/redo

Returns:
Type
boolean

notifyRollback(msg)

Parameters:
Name Type Description
msg string

onRollback(callback)

Adds a callback to be triggered when a burst update fails and is beeing rolled back.

Parameters:
Name Type Description
callback function
Returns:

this

Type
olympe.dc.BurstTransaction

push(object, values)

Push all the property values from the specified Observable to update the specified instance.

Parameters:
Name Type Description
object olympe.dc.Tag
values rxjs.Observable.<!Map.<!olympe.dc.registry.Property, *>>

setAsReversible()

Sets this burst transaction as reversible (for undo/redo).

Returns:
Type
olympe.dc.BurstTransaction

setDebounceInterval(interval)

Set frequency of update messages sent to the datacloud

Parameters:
Name Type Description
interval number
Returns:

this

Type
olympe.dc.BurstTransaction

stop()

Stops and sends the last updates in the data-cloud.


toString()


update(instance, property, flowValue)

Updates the value of a property of an instance each time the specified data-flow gets a new value.

Parameters:
Name Type Description
instance olympe.dc.InstanceTag

The instance to update.

property olympe.dc.InstanceTag

The property to update.

flowValue olympe.df.Proxy | olympe.df.FlowSource

The data-flow used to update the property.

Type Definitions


Update(instanceTag, propertyTag, value)

Parameters:
Name Type Description
instanceTag string
propertyTag string
value *