Module system

Source
Expand description

a system to watch for new points from other processes or threads

Modules§

cb
lks_tap takes a PointHandler.

Structs§

LkSystem
A linkspace system. The struct is not !Send. use lks_open in each thread. The first opened in each thread is set as the thread ‘default’.
LksInfo
miscellaneous information about the system

Enums§

MutateOp

Functions§

_lks_dump
lks_await_write
A future awaiting new lks_save to the storage engine.
lks_chsys
lks_current
get the current system - defaults to the first call to [lks_open*]
lks_forget
lks_forget_hashes
lks_from_info
lks_info
get [LkInfo] of a linkspace system
lks_last
Last recv stamp of this system. i.e. last result from lks_process
lks_list_watches
iterate over all active (WatchID,Query, test result) - test result does not check for limits and recv bounds
lks_multi_tap
lks_mutate
lks_open
open or create a LkSystem.
lks_open_inmem
opens an in memory linkspace system. Unlike lks_open the data is not persistent, nor can it be shared across processes, but it can be lks_split and used across threads.
lks_process
process the log of new packets and trigger callbacks. Updates the reader to the latest state.
lks_process_async
an alias for while(true) {lks_process(lks); lks_await_write(lks).await } Useful in an async context where other routines tap the system. *
lks_process_while
process callbacks until either:
lks_save
save a point - must lks_process* for it to be show up in a lks_scan*. Returns true if new and false if it is old. By convention if the current xstamp of a point equals zero, the database will copy the recv stamp into xstamp - This does not update the point provided as an argument.
lks_save_all
save multiple packets at once - returns the number of new packets written
lks_save_all_ext
returns the range [incusive,exclusive) of recv stamps used to save new packets. total_new = r.1-r.0
lks_save_new
Calls on_new - after saving - for each new point. Point::recv will return the stamp as just set in the database.
lks_scan
Call the callback for every query matched packet in storage. Note that new packets are only readable after a call to lks_process_*. Unlike lks_tap this only checks the :scan / :linkscan options (it does nothing for :notify, or :watch) If no :scan is set assumes :scan space-desc Break early if the callback returns true. returns number of matches. Positive if cb returned true, otherwise negative
lks_scan_hashes
TODO: DOC
lks_scan_one_hash_ref
read a single packet directly without copying.*
lks_scan_one_ref
read a single packet directly without copying.*
lks_split
create a clone without any callbacks. Usually to send to another thread. Requires its own lks_process calls.
lks_stop
close lks_tap watches based on the query id ‘:watch ID’ in the query.
lks_stop_query
lks_tap
If the :scan option is set, cb for all matching packets. If the :watch option is set, watch for new matching packets.
lks_tap2
lks_tap with a custom log [tracing::Span] The span will be entered on every callback.
lks_watch
lks_tap that ignores the :scan option, and inserts a :watch option if none are present.
lks_watch2
lks_watch with a custom log [tracing::Span] The span will be entered on every callback.
vspan
See lks_tap2