[RFC] Use arrays instead of iterable for multiple cache items #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using arrays makes the API slightly stricter and allows consumers to
consistently rely on associative arrays for getMultiple() and
setMultiple().
I'm filing this as an RFC to discuss whether
arraytype declaration provide more value over the currentiterabletype. From a practical perspective this doesn't make much of a difference because our existingArrayCacheimplementation already usesarrayanyway. By adding this to the interface documentation, we can make the API more consistent. In particular, see the updated documentation for thegetMultiple()call to see why I think this could be useful.The
iterabletype was added as part of #32 by @krlv in an attempt to mimic PSR-16. While I can see some use in supportingiterablein a blocking PSR-16 implementation (such as cache warmup with a very large number of keys), I'm not sure this really applies to this async API.