class Async::Container::Keyed
This helps implement persistent processes that start up child processes per directory or configuration file. If those directories and/or configuration files are removed, the child process can then be cleaned up automatically, because those key/value pairs will not be marked when reloading the container.
Tracks a key/value pair such that unmarked keys can be identified and cleaned up.
def clear!
def clear! @marked = false end
def initialize(key, value)
@parameter key [Object] The key.
Initialize the keyed instance
def initialize(key, value) @key = key @value = value @marked = true end
def mark!
def mark! @marked = true end
def marked?
def marked? @marked end
def stop?
Stop the instance if it was not marked.
def stop? unless @marked @value.stop return true end end