Holds a race in Roux.Blob open: at the file operations a gate names,
it runs an action after the operation completed and before the store
sees its result. A check-then-act race in the store then happens on
every run: the gate is the other process, acting between the check and
the act.
The store's file operations are raw (Roux.Blob.IO), past the VM's
file server, so this hangs on Roux.Blob.IO's hook rather than
standing in for the server. Install it only in a VM of its own
(:peer): while it is installed, every store operation of the VM goes
through it.
A gate is a map:
:name— whatuninstall/0reports its action's result under;:ops— the operations it watches (:read_file,:write_file,:read_file_info,:read_link_info,:chmod,:utime,:list_dir,:rename(named by its source),:delete,:make_dir,:del_dir,:make_link(named by the existing file),:hash_file);:path— the path they name;:prefix— true to watch every path under:pathas well;:nth— which of the watched operations it acts at (default 1);:action—{module, function, args}, run once, in a process of its own that the operation waits for; its own operations pass by the gate, which has already acted.
Summary
Functions
Puts gates in front of the store's file operations.
Takes the gates away, and returns each one's action's result by name:
:not_run for a gate whose operation never came.