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

Add Queue with Fixed implementation #1

Merged
merged 19 commits into from
May 31, 2024
Merged

Add Queue with Fixed implementation #1

merged 19 commits into from
May 31, 2024

Conversation

mycognosist
Copy link
Contributor

@mycognosist mycognosist commented May 6, 2024

  • Add Queue trait
    • Including doc comments
  • Add Fixed implementation of Queue
    • Including basic tests
  • Add fuzzers for enqueue, dequeue, bulk enqueue and bulk dequeue

@mycognosist mycognosist changed the title [WIP] Add Queue with Fixed implementation Add Queue with Fixed implementation May 7, 2024
@mycognosist mycognosist requested a review from AljoschaMeyer May 7, 2024 11:02
@mycognosist mycognosist added the enhancement New feature or request label May 7, 2024
@AljoschaMeyer
Copy link
Contributor

Generally looks good, sorry about the invariant hiccup this morning. Queues use errors to signal when they are full/empty, but it is perfectly fine to retry later. Producers/consumers work differently, they block (or suspend) until they can produce/consume more data. Queues don't have that mechanism.

@AljoschaMeyer
Copy link
Contributor

For the fuzz tests, could you make sure that they catch simple errors in the fixed capacity implementation (say, deliberately introducing off-by-one errors). I can't see the progress, so for all I know, the fuzz tests passed at first go (because they are faulty and I am just not seeing it).

@mycognosist
Copy link
Contributor Author

For the fuzz tests, could you make sure that they catch simple errors in the fixed capacity implementation (say, deliberately introducing off-by-one errors). I can't see the progress, so for all I know, the fuzz tests passed at first go (because they are faulty and I am just not seeing it).

Good idea. I introduced off-by-one errors in several places successively and each of them failed as expected.

@mycognosist mycognosist requested a review from AljoschaMeyer May 14, 2024 10:33
@mycognosist mycognosist merged commit d771a3f into main May 31, 2024
1 check passed
@mycognosist mycognosist deleted the add_queue_trait branch May 31, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants