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

Support different kinds of queues through a trait. #8

Merged
merged 2 commits into from
Jan 16, 2021
Merged

Conversation

elshize
Copy link
Owner

@elshize elshize commented Jan 16, 2021

Breaking change

Instead of add_queue and add_bounded_queue, there is only add_queue that takes the queue as argument. This allows for cleaner API and different queue support:

simulation.add_queue(Fifo::default());
simulation.add_queue(PriorityQueue::bounded(5));

Type inference should work most of the time, which cleans up the code. In case it's not possible, one can instantiate a queue explicitly:

Fifo::<i32>::default()

@elshize elshize added the enhancement New feature or request label Jan 16, 2021
@elshize elshize self-assigned this Jan 16, 2021
@elshize elshize added this to the v0.1.2 milestone Jan 16, 2021
@elshize elshize merged commit cd24d9e into main Jan 16, 2021
@elshize elshize deleted the generic-queue branch January 16, 2021 21:04
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.

None yet

1 participant