joe-at-startupmedia / pmon3

Golang Production Process Manager
10 stars 0 forks source link

groups #35

Closed joe-at-startupmedia closed 1 month ago

joe-at-startupmedia commented 1 month ago

This will allow the ability to assign processes to groups with m2m cardinality. This will allow executions of applicable commands on the group level.

joe-at-startupmedia commented 1 month ago

A thread on subcommands: https://github.com/spf13/cobra/issues/1526

joe-at-startupmedia commented 1 month ago

list of commands which operate on the process level which need to be implemented:

joe-at-startupmedia commented 1 month ago

del command operates on the group entity while the drop command operates on the process associated with the group. Because the drop command was implemented it might also be useful to implement the init command.

joe-at-startupmedia commented 1 month ago

before init is implemented:

Note configuration-based group specific should initially only support inserts because updates would have to detect changes from previous group associations and delete them accordingly. If updates were eventually supported they would need to take the following steps:

  1. detect differences in the existing process-group association from the configuration file
  2. drop all existing process-group associations for processes specified in the configuration file
  3. apply the group insertion and process-group associations
joe-at-startupmedia commented 1 month ago

Consider storing a Hashset for fast lookups: https://pkg.go.dev/github.com/emirpasic/gods/sets/hashset

This lib is missing a utility to store an integer slice as a hash:

https://forum.golangbridge.org/t/hashcode-for-a-array/6661 https://stackoverflow.com/questions/48272453/what-would-be-a-good-hash-functionor-something-similar-for-an-unique-integer-a

Where an integer slice would probably be a better implementation than a hash map since collisions would be near-impossible.

joe-at-startupmedia commented 1 month ago

released in 1.16.0.