Comments (6)
Thanks, I will try this out shortly. However I've got another issue, and I can open a bug report if you like. I'm trying a basic redis backed setup. SetAsync works, but GetOrSetAsync is not setting the value into redis. It is setting the value into memory however, and does return the expected value.
If I remove the redis extensions, then it works and does set the value into redis. However I can't really use redis without them, since I have scaled app services in azure. Note I need to remove both redis extensions, having either one will cause the problem.
Here's a basic reproducer I mocked up in linqpad.
var redisConnection = ConnectionMultiplexer.Connect("-azure-cnxn-string-");
var c = new CacheStack(
new ICacheLayer[]
{
new MemoryCacheLayer(),
new RedisCacheLayer(redisConnection, 0)
},
new ICacheExtension[]
{
new AutoCleanupExtension(TimeSpan.FromMinutes(5)),
new RedisLockExtension(redisConnection, 0),
new RedisRemoteEvictionExtension(redisConnection)
});
// works
var result1 = c.SetAsync("setasync", "hello world", TimeSpan.FromHours(24)).GetAwaiter().GetResult();
// doesn't work
var result2 = c.GetOrSetAsync<string>("getorsetasync", old => Task.FromResult("hello world"), new CacheSettings(TimeSpan.FromMinutes(2))).GetAwaiter().GetResult();
result1.Dump();
result2.Dump();
from cachetower.
Hey @ErikPilsits-RJW - thanks for raising an issue! There shouldn't be any issues with serializing with protobuf if you are decorating your types like protobuf.net requires:
- ProtoContractAttribute on type
- Each property to have a ProtoMemberAttribute on it
I did just realise though that my documentation doesn't say that anywhere so that is definitely on me for not being clear. I'll look at updating the documentation soon.
Now if you do have those attributes and are still having issues, please provide me with the model that is causing the issue to see if I can recreate it.
from cachetower.
Thanks for that detailed information about this other issue. It will be easiest to track it in a second issue, especially if the issues aren't caused by the some underlying problem, however I should be able to look into this in the next day or two.
from cachetower.
Thanks. The suggestion for the protobuf attributes seems to have resolved the error, however I'll need to see it in redis to be sure, which requires resolving the other issue. I'll open a new issue for that now.
from cachetower.
All good on the protobuf front after adding the attributes.
from cachetower.
Awesome, glad that solves this issue. Will definitely update the readme to better indicate this. 🙂
from cachetower.
Related Issues (20)
- Manually Trigger Background Refresh HOT 2
- Empty list serialized as null when memory and redis cache are used HOT 1
- Implement WaitToFinish strategy HOT 1
- NullReferenceException on blocked task when original task faulted HOT 2
- Investigate Coyote for concurrency testing
- GetOrSetAsync() not refreshing for expired cache entries HOT 5
- How to Background Refresh work? HOT 3
- Add synchronous methods HOT 1
- JsonFileCacheLayer - Use previous cache on next start HOT 10
- Consider using FASTER HOT 2
- RedisLockExtension Questions HOT 1
- Cache stack builder delegate which provides IServiceProvider HOT 6
- Upgrading from v0.11.x to Custom Serializers with RedisCacheLayer breaks existing caches HOT 32
- Caching layers support atomic operations? HOT 1
- Ability to set CacheSettings depending on the result of the valueFactory HOT 4
- Dependency Dashboard
- Sliding expiries
- Add in-memory provider that uses IMemoryCache
- FileCacheProvider - exception while opening invalid Manifest HOT 1
- CacheStack protected accessors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cachetower.