So I have an endpoint which returns the contents of many entities in parallel.
I have a shared service which calls this endpoint and puts them into a shared $cacheFactory
.
When GET /base_entity/<id>/all
route is hit first, then GET /entity/<id>
should return the cached copy.
What's best-practice in telling the GET /entity/<id>
service to not perform an HTTP get until GET /base_entity/<id>/all
has had a chance to complete?
$broadcast
/$emit
approach seems odd. I suppose I could use that shared $cacheFactory
with cache.put('START /all for ID:' +, id)
and cache.put('FIN /all for ID:' +, id)
, but not sure if that's a strange way of solving the problem.