Match logic using keys organized as hierarchical lists
Property keys that are lists look like ["first", "second", "third"].
These are intended to create a hierarchical organization of keys. Matching
patterns involves checking whether the pattern is at the beginning of the
key. This makes it possible to get notified on every property change where
the key begins with ["first", "second"]. This is a really common use case
when using hierarchically organized keys.
Two special atoms can be used:
:_- match anything at this part of the list:$- match the end of the list
Summary
Functions
Check whether a pattern is valid
Check whether a property is valid
Build an ETS match-spec equivalent to matches?/2 for pattern
Returns true if the pattern matches the specified property
Functions
Check whether a pattern is valid
Returns :ok on success or {:error, error} where error is an Exception struct with
information about the issue.
Check whether a property is valid
Returns :ok on success or {:error, error} where error is an Exception struct with
information about the issue.
Build an ETS match-spec equivalent to matches?/2 for pattern
StringPath patterns translate directly into list patterns in the match-spec
head: :_ is already an ETS wildcard, and the tail is left open with :_
unless the pattern ends in :"$", in which case it is [] to anchor the
length. The body returns the whole row via :"$_", so PropertyTable does
not need to know the row layout. Returns :error for invalid patterns.
Returns true if the pattern matches the specified property