even more refactoring
Some checks failed
Build and Publish / BuildAndDeploy (push) Successful in 3m7s
Build and Publish / BuildAndDeployAmd64 (push) Has been cancelled

This commit is contained in:
matst80
2025-10-10 11:46:19 +00:00
parent 12d87036f6
commit 716f1121aa
32 changed files with 3857 additions and 953 deletions

View File

@@ -426,20 +426,13 @@ func (p *SyncedPool) getGrain(id CartId) (Grain, error) {
return grain, nil
}
// Process applies mutation(s) to a grain (local or remote).
func (p *SyncedPool) Process(id CartId, mutations ...interface{}) (*CartGrain, error) {
// Apply applies a single mutation to a grain (local or remote).
func (p *SyncedPool) Apply(id CartId, mutation interface{}) (*CartGrain, error) {
grain, err := p.getGrain(id)
if err != nil {
return nil, err
}
var res *CartGrain
for _, m := range mutations {
res, err = grain.Apply(m, false)
if err != nil {
return nil, err
}
}
return res, nil
return grain.Apply(mutation, false)
}
// Get returns current state of a grain (local or remote).