Skip to content
This repository was archived by the owner on Aug 20, 2022. It is now read-only.
This repository was archived by the owner on Aug 20, 2022. It is now read-only.

KeyValueStore Single Callback for Multiple Concurrent Gets #10

@rdev34

Description

@rdev34

I ran into the issue where I needed to grab 3 KeyValueStore values at once and saw two ways to structure my code:

  1. Nest the requests so that second request is inside callback of first, etc
  2. Do all requests concurrently and monitor status of requests until all are complete.

Option 1) is favored because of the low complexity to achieve a block of code that will handle all 3 values, but results in disgusting nesting of KVS requests.
Option 2) has no nesting, but is too complex and verbose to leverage easily because of the need to spin up a thread to wait for the requests.

We need a KeyValueStore Get solution that uses Option 2) under the hood. It runs all the requests concurrently (or aggregates to 1 request), and returns all the results in a single callback.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions