Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Use an enum to represent faucet queue state changes #1160

Open
jbearer opened this issue Jun 22, 2022 · 0 comments
Open

Use an enum to represent faucet queue state changes #1160

jbearer opened this issue Jun 22, 2022 · 0 comments
Labels

Comments

@jbearer
Copy link
Member

jbearer commented Jun 22, 2022

Currently, there are 3 state changes persisted on disk:

  • Some(0) -- a new request was created
  • Some(n > 0) -- a request has received its nth grant
  • None -- a request was completed

We can make the code more clear using an enum like

enum QueueOp {
  New,
  Grant(n),
  Complete,
}
@jbearer jbearer added the faucet label Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant