-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Labels
Description
Sometimes application make duplicate downstream calls when serving a request. One way is to make the Task sharable and pass it around, but it’s sometimes hard to refactor the code while maintaining code readability. It would be great that parseq can provide some cache capability to avoid duplicate calls.
Some idea may be: ParSeq can provide a plan-local cache <K, Task> where K is user-defined key and Task computes result. It would make sense to implement it on a ParSeq level because:
- ParSeq has a well defiled Plan life-cycle with hook when Plan completes (even after response has been sent to the client)
- Natural API for asynchronous computation which is a most common use case for a cache (we have seen similar feature requests for Rest.li request results)