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

Feature Request: Do not queue SELECT queries if no writing is happening. #11

Open
Jwink3101 opened this issue Oct 5, 2017 · 1 comment

Comments

@Jwink3101
Copy link

First of all, I may be mistaken in how this all works, but it seems like all queries are queued and processed serially. Since there is already a conditional for if using a "SELECT ...", why not execute them directly?

Or, am I mistaken and you can't read from a database while locked (obviously you can't write). If that is the case, you could check the queue size and then execute in parallel.

@dashawn888
Copy link
Contributor

It started this way. There are some weird async issues when selects were just performed and returned. So to fix it we put selects in the same serialization as write operations.

If there is 0 in the queue size then the select will execute immediately since the blocking queue get while unblock and execute. I'm not sure what the added latency is for this but it is probably negligible.

This could be cleaned up by putting the queue put in execute outside the if block since it's not the actual choice but if you wait to return results is.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants