Data cache interface for the ability to wrap the batch function and its positive results in the cache. Now you can use non-memory cache, like redis or sql.
Timeout for batch function. If user close context before batch func done, all data return with error and will be put in cache. WithTimeout help to wrap original context with tracing, variables, but without timeout.
In this review, I added a few options:
WithTimeout
help to wrap original context with tracing, variables, but without timeout.