bond_core
bond_core copied to clipboard
Would a BondSet class be useful?
In my use-case I have a node which manages a collection of bonds with other nodes. There's a few operations which naturally fit into a container class:
- The ability to start / stop all bonds
- The ability to check if all bonds have formed
- The ability to add a callback when all bonds have formed
- The ability to add a callback when at least one bond has broken
- The ability to partition bond ids by their status i.e. return {formed_ids, unformed_ids}
I've implemented this as a custom class. I'm wondering if there'd be interest in adding it to the main codebase? I feel like this would simplify use-cases that work with multiple bonds by keeping the book-keeping code within a BondSet
class.