Skip to content

Commit

Permalink
comment on possible improvement of GET
Browse files Browse the repository at this point in the history
  • Loading branch information
jabielecki committed Mar 4, 2024
1 parent e2137be commit 268ded1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ var maxItems = 500
// modification of items.
// Unfortunately, the protection does not cover any requests from other clients/processes/systems.
func (client *Client) Get(path string, mods ...func(*Req)) (Res, error) {
// This channel operation will wait for any writers to complete first.
// Improvement idea: optimistic GET without any waiting. But then if it returns 500 items,
// throw its result away, wait for lock, restart with pagination?
client.readers <- +1
defer func() { client.readers <- -1 }()

Expand Down

0 comments on commit 268ded1

Please sign in to comment.