Open hanzki opened 5 years ago
@hanzki Hey! Sorry for the loooong silence. This sounds like a problem. If you are still interested in doing so, submitting a PR against master
branch is appreciated.
@hanzki @mumoshu I think you want to submit a pull request against legacy
branch, not against master
. master
"only" contains latest Play support (2.7), whereas legacy
branch contains all other, older versions. EDIT: And this pull request needs to be done for Play 2.5 and older.
@mkurz Thanks! You are absolutely correct - seems like I'm losing my memory...
So probably we're talking about this: https://github.com/mumoshu/play2-memcached/blob/legacy/plugin/src/main/play_2.5/com/github/mumoshu/play2/memcached/MemcachedCacheApi.scala#L73
I noticed that the
set()
andremove()
implementation ofCacheAPI
call async methods onspy.memcached.MemcachedClient
which return futures but the futures are ignored. The default cache in play (prior to version 2.6) is synchronous and any replacement of the default implementation should conform to the same interface.I ran into this problem when a value that was just saved with
set()
wasn't found with the followingget()
call. Because theCacheAPI
interface usesUnit
as the return type forset()
andremove()
the implementation ofplay2-memcached
should await the futures returned byspy.memcached.MemcachedClient
. The async methods could still be provided by explicitly calling the plugin with for example:I can create a pull request for this but I'm not sure on which branch/commit should I base it on and to which branch should I target the PR such that this fix can be introduced to the versions meant for older play versions?