Open Vishal-Puri opened 11 years ago
A better approach would be to have an interface for CacheEntry and make HttpCache reference that. Custom implementation could then be plugged in to the HttpCache.
Thanks for the comments, it certainly makes sense to turn CacheEntry into an interface. Is that sufficient for what you want? Or is there something you are seeking when you say "HttpCache implementations should have access to CacheEntry"?
I wanted to use persisted (Redis/Memcache) HttpCache because in-memory cache won't scale in my case. Since CacheEntry is currently package-private, my custom HttpCache implementation can't compile.
Also, even if CacheEntry was made public it would still be not very useful for disk based caching because of it's non-serializable nature. Hence, I requested to provide a CacheEntry interface and it would be great if this interface would't depend upon Http API so that it's easier to dump implementations into high performance distributed caches like Redis etc, without requiring any custom serialization logic.
Makes sense. I can quickly make that an interface with a public default implementation. We can adjust from there.
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
Excellent! I will give it a go and code from git should be good for now.
Thank you
On Thu, May 9, 2013 at 12:17 PM, John Heintz notifications@github.comwrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910 .
Great. Let me if it works and if you need more exposure.
Also, feel free to code an AbstractCacheEntry that generalizes some of this and send me a pull request.
On Thu, May 9, 2013 at 2:50 PM, Vishal Puri notifications@github.com wrote:
Excellent! I will give it a go and code from git should be good for now. Thank you On Thu, May 9, 2013 at 12:17 PM, John Heintz notifications@github.comwrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910 .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17685649
As a start, made CacheEntry interface public. I think interface was IDE generated. Submitting a patch.
On Thu, May 9, 2013 at 1:00 PM, John Heintz notifications@github.comwrote:
Great. Let me if it works and if you need more exposure.
Also, feel free to code an AbstractCacheEntry that generalizes some of this and send me a pull request.
On Thu, May 9, 2013 at 2:50 PM, Vishal Puri notifications@github.com wrote:
Excellent! I will give it a go and code from git should be good for now. Thank you On Thu, May 9, 2013 at 12:17 PM, John Heintz notifications@github.comwrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910> .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17685649
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17686194 .
Not public... Doh! I'll fix that in an hour.
On Thu, May 9, 2013 at 8:28 PM, Vishal Puri notifications@github.com wrote:
As a start, made CacheEntry interface public. I think interface was IDE generated. Submitting a patch. On Thu, May 9, 2013 at 1:00 PM, John Heintz notifications@github.comwrote:
Great. Let me if it works and if you need more exposure.
Also, feel free to code an AbstractCacheEntry that generalizes some of this and send me a pull request.
On Thu, May 9, 2013 at 2:50 PM, Vishal Puri notifications@github.com wrote:
Excellent! I will give it a go and code from git should be good for now. Thank you On Thu, May 9, 2013 at 12:17 PM, John Heintz notifications@github.comwrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910> .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17685649
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17686194 .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17699681
No problem, take your time!
On Thursday, May 9, 2013, John Heintz wrote:
Not public... Doh! I'll fix that in an hour.
On Thu, May 9, 2013 at 8:28 PM, Vishal Puri <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>
wrote:
As a start, made CacheEntry interface public. I think interface was IDE generated. Submitting a patch. On Thu, May 9, 2013 at 1:00 PM, John Heintz <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
Great. Let me if it works and if you need more exposure.
Also, feel free to code an AbstractCacheEntry that generalizes some of this and send me a pull request.
On Thu, May 9, 2013 at 2:50 PM, Vishal Puri <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>
wrote:
Excellent! I will give it a go and code from git should be good for now. Thank you On Thu, May 9, 2013 at 12:17 PM, John Heintz < notifications@github.com <javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910> .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17685649
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17686194> .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17699681
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17700630 .
Should really be public now! (Did you check the last commit message, or do I need to followup with written messages to signal you?)
On Thu, May 9, 2013 at 9:53 PM, Vishal Puri notifications@github.comwrote:
No problem, take your time!
On Thursday, May 9, 2013, John Heintz wrote:
Not public... Doh! I'll fix that in an hour.
On Thu, May 9, 2013 at 8:28 PM, Vishal Puri <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>
wrote:
As a start, made CacheEntry interface public. I think interface was IDE generated. Submitting a patch. On Thu, May 9, 2013 at 1:00 PM, John Heintz <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
Great. Let me if it works and if you need more exposure.
Also, feel free to code an AbstractCacheEntry that generalizes some of this and send me a pull request.
On Thu, May 9, 2013 at 2:50 PM, Vishal Puri <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>
wrote:
Excellent! I will give it a go and code from git should be good for now. Thank you On Thu, May 9, 2013 at 12:17 PM, John Heintz < notifications@github.com <javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910>
.
Reply to this email directly or view it on GitHub:
https://github.com/GistLabs/mechanize/issues/67#issuecomment-17685649
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17686194> .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17699681
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17700630> .
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17701824 .
John D. Heintz Agile, Lean, and everything in between
President, Gist Labs http://gistlabs.com Senior Consultant, Cutter Consortium http://cutter.com
Twitter: @jheintz http://twitter.com/jheintz Phone: 512-633-1198
Thank you - I did check your last commit message. Strange, that my patch was somehow dropped and GitHub only shows the last comment.
On Fri, May 10, 2013 at 6:19 AM, John Heintz notifications@github.comwrote:
Should really be public now! (Did you check the last commit message, or do I need to followup with written messages to signal you?)
On Thu, May 9, 2013 at 9:53 PM, Vishal Puri notifications@github.comwrote:
No problem, take your time!
On Thursday, May 9, 2013, John Heintz wrote:
Not public... Doh! I'll fix that in an hour.
On Thu, May 9, 2013 at 8:28 PM, Vishal Puri <notifications@github.com<javascript:_e({},
'cvml', 'notifications@github.com');>>
wrote:
As a start, made CacheEntry interface public. I think interface was IDE generated. Submitting a patch. On Thu, May 9, 2013 at 1:00 PM, John Heintz < notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
Great. Let me if it works and if you need more exposure.
Also, feel free to code an AbstractCacheEntry that generalizes some of this and send me a pull request.
On Thu, May 9, 2013 at 2:50 PM, Vishal Puri < notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>
wrote:
Excellent! I will give it a go and code from git should be good for now. Thank you On Thu, May 9, 2013 at 12:17 PM, John Heintz < notifications@github.com <javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHub<
https://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910>
.
Reply to this email directly or view it on GitHub:
https://github.com/GistLabs/mechanize/issues/67#issuecomment-17685649
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17686194>
.
Reply to this email directly or view it on GitHub:
https://github.com/GistLabs/mechanize/issues/67#issuecomment-17699681
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17700630> .
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17701824> .
John D. Heintz Agile, Lean, and everything in between
President, Gist Labs http://gistlabs.com Senior Consultant, Cutter Consortium http://cutter.com
Twitter: @jheintz http://twitter.com/jheintz Phone: 512-633-1198
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17719529 .
I never got a patch or pull notice...
On Fri, May 10, 2013 at 11:50 AM, Vishal Puri notifications@github.com wrote:
Thank you - I did check your last commit message. Strange, that my patch was somehow dropped and GitHub only shows the last comment. On Fri, May 10, 2013 at 6:19 AM, John Heintz notifications@github.comwrote:
Should really be public now! (Did you check the last commit message, or do I need to followup with written messages to signal you?)
On Thu, May 9, 2013 at 9:53 PM, Vishal Puri notifications@github.comwrote:
No problem, take your time!
On Thursday, May 9, 2013, John Heintz wrote:
Not public... Doh! I'll fix that in an hour.
On Thu, May 9, 2013 at 8:28 PM, Vishal Puri <notifications@github.com<javascript:_e({},
'cvml', 'notifications@github.com');>>
wrote:
As a start, made CacheEntry interface public. I think interface was IDE generated. Submitting a patch. On Thu, May 9, 2013 at 1:00 PM, John Heintz < notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
Great. Let me if it works and if you need more exposure.
Also, feel free to code an AbstractCacheEntry that generalizes some of this and send me a pull request.
On Thu, May 9, 2013 at 2:50 PM, Vishal Puri < notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>
wrote:
Excellent! I will give it a go and code from git should be good for now. Thank you On Thu, May 9, 2013 at 12:17 PM, John Heintz < notifications@github.com <javascript:_e({}, 'cvml', 'notifications@github.com');>>wrote:
It's now public, and an interface. Likely I need to abstract much of the InMemoryCacheEntry into a usable base AbstractCacheEntry, but this should unblock this issue. Can you try the latest code from git, or do you need a new maven package?
— Reply to this email directly or view it on GitHub<
https://github.com/GistLabs/mechanize/issues/67#issuecomment-17683910>
.
Reply to this email directly or view it on GitHub:
https://github.com/GistLabs/mechanize/issues/67#issuecomment-17685649
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17686194>
.
Reply to this email directly or view it on GitHub:
https://github.com/GistLabs/mechanize/issues/67#issuecomment-17699681
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17700630> .
— Reply to this email directly or view it on GitHub< https://github.com/GistLabs/mechanize/issues/67#issuecomment-17701824> .
John D. Heintz Agile, Lean, and everything in between
President, Gist Labs http://gistlabs.com Senior Consultant, Cutter Consortium http://cutter.com
Twitter: @jheintz http://twitter.com/jheintz Phone: 512-633-1198
— Reply to this email directly or view it on GitHubhttps://github.com/GistLabs/mechanize/issues/67#issuecomment-17719529 .
Reply to this email directly or view it on GitHub: https://github.com/GistLabs/mechanize/issues/67#issuecomment-17731365
MechanizeAgent has a public constructor that accepts HttpCache. HttpCache implementations should have access to CacheEntry otherwise it would not be possible to plug custom HttpCache implementations.