Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@danut007ro
Copy link
Contributor

…pports multiput

Serialization and tests

@Ocramius
Copy link
Member

@danut007ro seems simple/solid to me.
@guilhermeblanco is there any location in the ORM where we can use this?

@kimhemsoe
Copy link
Member

@Ocramius Maybe the redis providers could use multi or pipeline?

@stof
Copy link
Member

stof commented Dec 16, 2015

@Ocramius the SLC should be review to see whether it can benefit from it (this is the place benefiting from MultiGet already)

@Ocramius Ocramius assigned guilhermeblanco and unassigned Ocramius Dec 25, 2015
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking against false seems wrong, as you will always get an array result, no?
Also, you should probably just use empty(), to avoid counting the elements when not needed.

@Tobion
Copy link
Contributor

Tobion commented Dec 25, 2015

I don't think it's a good idea to introduce a new interface for this. IMO MultiGetCache should be merged into Cache in 2.0 anyway. CacheProvider already emulates fetchMultiple anyway which is always possible. And the same would be true for saveMultiple.
So IMO this features should be implemented without an interface. Otherwise we would just create an interface that we don't want in the long run at all.

@Ocramius
Copy link
Member

@Tobion a few things:

  • changing an existing interface needs a strong reason to do so
  • save and load can already be on separate interfaces: they are not necessarily symmetrical operations anyway
  • this patch is in line with already quite successful interface segregation of this component: I'd rather keep it like that, then aggregate all interfaces into something like CacheProvider for 3.x

From my point of view, the patch is ok, but indeed we may re-design some of the interfaces for 3.x

@Tobion
Copy link
Contributor

Tobion commented Dec 25, 2015

Well if ISP is really wanted for such a small domain, then it should be done fully. Currently it's just random and more based on historic reasons than on ISP. For example, why the getStats in Cache when it is probably the least common used method. And if multi save and multi get are different interfaces than, single save and single get should be too. Otherwise it's arbitrary.

@Ocramius
Copy link
Member

@Tobion fully agree. I think Zend\Cache does it quite right on that front (each adapter has a series of capabilities)

@danut007ro
Copy link
Contributor Author

@Ocramius I updated the code according to your review (thank you for it). Have a look and tell me what you think. Thanks!

@Ocramius
Copy link
Member

Looks good to me.

Waiting for @guilhermeblanco to do a last sweep.

@andrerom
Copy link

Nice, this will become useful.

@Ocramius Ocramius assigned Ocramius and unassigned guilhermeblanco Dec 30, 2015
@Ocramius
Copy link
Member

got a 👍 from @guilhermeblanco! Merging \o/

Thanks @danut007ro

Ocramius added a commit that referenced this pull request Dec 30, 2015
Added MultiPutCache interface and implementations for drivers that su…
@Ocramius Ocramius merged commit 6e52f02 into doctrine:master Dec 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants