Module khepri_evf

Khepri event filters.

Description

Khepri event filters.

Data Types

event_filter()

event_filter() = tree_event_filter()

An event filter.

The following event filters are supported: An event filter can be explicitly constructed using the functions provided in this module. However, some common types will be automatically detected and converted to an event filter with default properties. See each event filter type for more details.

priority()

priority() = integer()

An event filter priority.

This is an integer to prioritize event filters: the greater the priority, the more it is prioritized. Negative integers are allowed.

The default priority is 0.

tree_event_filter()

tree_event_filter() = #evf_tree{path = khepri_path:native_pattern(), props = khepri_evf:tree_event_filter_props()}

A tree event filter.

It takes a path pattern to monitor and optionally properties.

tree_event_filter_props()

tree_event_filter_props() = #{on_actions => [create | update | delete], priority => khepri_evf:priority()}

Tree event filter properties.

The properties are: A Khepri path, whether it is a native path or a Unix-like path, can be used as a tree event filter. It will be automatically converted to a tree event filter with default properties.

Function Index

tree/1Constructs a tree event filter.
tree/2Constructs a tree event filter.
wrap/1Automatically detects the event filter type and ensures it is wrapped in one of the internal types.
get_priority/1Returns the priority of the event filter.
set_priority/2Sets the priority of the event filter.

Function Details

tree/1

tree(PathPattern) -> EventFilter

Constructs a tree event filter.

See also: tree/2.

tree/2

tree(PathPattern, Props) -> EventFilter

Constructs a tree event filter.

See also: tree_event_filter().

wrap/1

wrap(Input) -> EventFilter

Input: an already created event filter, or any term which can be automatically converted to an event filter.

returns: the created event filter.

Automatically detects the event filter type and ensures it is wrapped in one of the internal types.

get_priority/1

get_priority(EventFilter) -> Priority

EventFilter: the event filter to update.

returns: the priority.

Returns the priority of the event filter.

set_priority/2

set_priority(EventFilter, Priority) -> EventFilter

EventFilter: the event filter to update.
Priority: the new priority.

returns: the updated event filter.

Sets the priority of the event filter.


Generated by EDoc