Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade datastructures #11

Merged
merged 12 commits into from
May 28, 2024
Merged

Upgrade datastructures #11

merged 12 commits into from
May 28, 2024

Conversation

NickMcSweeney
Copy link
Member

Upgrade internal datastructures

this PR targets 3 areas

  1. atomics: most of the atomic implementations used a deprecated set of methods. the client should be updated to use the @atomic macros
  2. subscription: the dictionary storage of topics was a bit simple causing increasingly complex validations and string matching. topics are moved to a Trie data structure where callback functions are stored in a trie graph with topic pieces as keys.
  3. asynchronous process management: particularly when disconnecting the read and write loops would throw errors, better process management is added to prevent loops hanging waiting for data.

Changes

  • all atomics use @atomic macros
  • a custom implementation of a Ordered tree data structure is created
    • on subscription a callback function is added to the trie struct based on the topic using insert!
    • on publish a callback function is looked up using get
    • on unsubscribe a callback function is removed using remove!
  • an if check is added in the read loop to make sure the io is not eof
  • an if check is added in the write loop to make sure there is data to write
  • unit tests are updated
  • precompile is updated

@NickMcSweeney NickMcSweeney merged commit 7407565 into main May 28, 2024
4 of 5 checks passed
@NickMcSweeney NickMcSweeney deleted the feature/upgrade-datastructures branch May 28, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant