Skip to content

Commit

Permalink
Support different read mode in RedisHybridCacheClient (#83)
Browse files Browse the repository at this point in the history
* Support different read mode in RedisHybridCacheClient

* Trigger license check

* Trigger the check (revert)

---------

Co-authored-by: Zinnia Wang <[email protected]>
  • Loading branch information
zinniawang149 and Zinnia Wang authored Mar 12, 2024
1 parent ceb704b commit 760c42a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,11 @@ public RedisCacheClientOptionsBuilder ShouldThrowOnSerializationError(bool shoul
Target.ShouldThrowOnSerializationError = shouldThrow;
return this;
}

public RedisCacheClientOptionsBuilder ReadMode(CommandFlags commandFlags)
{
Target.ReadMode = commandFlags;
return this;
}
}
}
3 changes: 2 additions & 1 deletion src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public RedisHybridCacheClient(RedisHybridCacheClientOptions options, InMemoryCac
.ConnectionMultiplexer(options.ConnectionMultiplexer)
.Serializer(options.Serializer)
.LoggerFactory(options.LoggerFactory)
.ShouldThrowOnSerializationError(options.ShouldThrowOnSerializationError)),
.ShouldThrowOnSerializationError(options.ShouldThrowOnSerializationError)
.ReadMode(options.ReadMode)),
new RedisMessageBus(o => o
.Subscriber(options.ConnectionMultiplexer.GetSubscriber())
.Topic(options.RedisChannelName)
Expand Down

0 comments on commit 760c42a

Please sign in to comment.