Class: Vivarium::Registry
- Inherits:
-
Object
- Object
- Vivarium::Registry
- Defined in:
- lib/vivarium/api_server.rb
Overview
Wraps the daemon’s live BPF target maps so the API can (un)register PIDs.
Instance Method Summary collapse
-
#initialize(config_root_targets, config_spawned_targets) ⇒ Registry
constructor
A new instance of Registry.
- #register(pid) ⇒ Object
- #unregister(pid) ⇒ Object
Constructor Details
#initialize(config_root_targets, config_spawned_targets) ⇒ Registry
Returns a new instance of Registry.
46 47 48 49 |
# File 'lib/vivarium/api_server.rb', line 46 def initialize(config_root_targets, config_spawned_targets) @config_root_targets = config_root_targets @config_spawned_targets = config_spawned_targets end |
Instance Method Details
#register(pid) ⇒ Object
51 52 53 |
# File 'lib/vivarium/api_server.rb', line 51 def register(pid) @config_root_targets[pid] = 1 end |
#unregister(pid) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/vivarium/api_server.rb', line 55 def unregister(pid) @config_root_targets.delete(pid) @config_spawned_targets.clear rescue KeyError nil end |