more changes
This commit is contained in:
@@ -427,14 +427,14 @@ func (p *SyncedPool) getGrain(id CartId) (Grain, error) {
|
||||
}
|
||||
|
||||
// Process applies mutation(s) to a grain (local or remote).
|
||||
func (p *SyncedPool) Process(id CartId, messages ...Message) (*FrameWithPayload, error) {
|
||||
func (p *SyncedPool) Process(id CartId, mutations ...interface{}) (*CartGrain, error) {
|
||||
grain, err := p.getGrain(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var res *FrameWithPayload
|
||||
for _, m := range messages {
|
||||
res, err = grain.HandleMessage(&m, false)
|
||||
var res *CartGrain
|
||||
for _, m := range mutations {
|
||||
res, err = grain.Apply(m, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -443,7 +443,7 @@ func (p *SyncedPool) Process(id CartId, messages ...Message) (*FrameWithPayload,
|
||||
}
|
||||
|
||||
// Get returns current state of a grain (local or remote).
|
||||
func (p *SyncedPool) Get(id CartId) (*FrameWithPayload, error) {
|
||||
func (p *SyncedPool) Get(id CartId) (*CartGrain, error) {
|
||||
grain, err := p.getGrain(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user