View Source PropertyTable.Event (property_table v0.2.5)

Struct sent to subscribers on property changes

  • :table - the table generating this event
  • :property - which property changed
  • :value - the new value
  • :timestamp - the timestamp (System.monotonic_time/0) when the changed happened
  • :previous_value - the previous value (nil if this property is new)
  • :previous_timestamp - the timestamp when the property changed to :previous_value. Use this to calculate how long the property was the previous value.

Summary

Functions

Convert event to the old tuple event format

Types

@type t() :: %PropertyTable.Event{
  previous_timestamp: integer(),
  previous_value: PropertyTable.value(),
  property: PropertyTable.property(),
  table: PropertyTable.table_id(),
  timestamp: integer(),
  value: PropertyTable.value()
}

Functions

@spec to_tuple(t()) ::
  {PropertyTable.table_id(), PropertyTable.property(), PropertyTable.value(),
   PropertyTable.value(), %{new_timestamp: integer(), old_timestamp: integer()}}

Convert event to the old tuple event format

This is only used for backwards compatibility. At some point, it hopefully will be removed.