Open bounoable opened 1 year ago
Provide an Aggregate Repository with cache features.
package example func example(repo aggregate.Repository) { // or aggregate.TypedRepository[...] cached := repository.NewCache(repo) // Only runs once q := query.New(...) cached.Query(context.TODO(), q) cached.Query(context.TODO(), q) // Only runs once id := uuid.New() cached.Fetch(context.TODO(), id) cached.Fetch(context.TODO(), id) // Clear cache cached.Reset() }
Fetch() cache implemented in 4b51c724c21f3992b55e61898b0967258a885762
Fetch()
Provide an Aggregate Repository with cache features.