Skip to content

Commit

Permalink
v1.1.3 -fix: PubSubNumPat #150
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Jun 21, 2023
1 parent c06ad29 commit d01177c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/FreeRedis/FreeRedis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>FreeRedis</AssemblyName>
<PackageId>FreeRedis</PackageId>
<RootNamespace>FreeRedis</RootNamespace>
<Version>1.1.2</Version>
<Version>1.1.3</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageProjectUrl>https://github.com/2881099/FreeRedis</PackageProjectUrl>
<Description>FreeRedis is .NET redis client, supports cluster, sentinel, master-slave, pipeline, transaction and connection pool.</Description>
Expand Down
4 changes: 2 additions & 2 deletions src/FreeRedis/IRedisClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public interface IRedisClient
string[] PubSubChannels(string pattern);
long PubSubNumSub(string channel);
long[] PubSubNumSub(string[] channels);
long PubSubNumPat(string message);
long PubSubNumPat();
void PUnSubscribe(params string[] pattern);
void UnSubscribe(params string[] channels);
bool ScriptExists(string sha1);
Expand Down Expand Up @@ -535,7 +535,7 @@ public interface IRedisClient
Task<string[]> PubSubChannelsAsync(string pattern);
Task<long> PubSubNumSubAsync(string channel);
Task<long[]> PubSubNumSubAsync(string[] channels);
Task<long> PubSubNumPatAsync(string message);
Task<long> PubSubNumPatAsync();
IDisposable PSubscribe(string pattern, Action<string, object> handler);
IDisposable PSubscribe(string[] pattern, Action<string, object> handler);
IDisposable Subscribe(string[] channels, Action<string, object> handler);
Expand Down
4 changes: 2 additions & 2 deletions src/FreeRedis/RedisClient/PubSub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ partial class RedisClient
public Task<string[]> PubSubChannelsAsync(string pattern) => CallAsync("PUBSUB".SubCommand("CHANNELS").Input(pattern), rt => rt.ThrowOrValue<string[]>());
public Task<long> PubSubNumSubAsync(string channel) => CallAsync("PUBSUB".SubCommand("NUMSUB").Input(channel), rt => rt.ThrowOrValue((a, _) => a.MapToList((x, y) => y.ConvertTo<long>()).FirstOrDefault()));
public Task<long[]> PubSubNumSubAsync(string[] channels) => CallAsync("PUBSUB".SubCommand("NUMSUB").Input(channels), rt => rt.ThrowOrValue((a, _) => a.MapToList((x, y) => y.ConvertTo<long>()).ToArray()));
public Task<long> PubSubNumPatAsync(string message) => CallAsync("PUBLISH".SubCommand("NUMPAT").InputRaw(message), rt => rt.ThrowOrValue<long>());
public Task<long> PubSubNumPatAsync() => CallAsync("PUBLISH".SubCommand("NUMPAT"), rt => rt.ThrowOrValue<long>());
#endregion
#endif

Expand All @@ -61,7 +61,7 @@ public IDisposable PSubscribe(string[] pattern, Action<string, object> handler)
public string[] PubSubChannels(string pattern) => Call("PUBSUB".SubCommand("CHANNELS").Input(pattern), rt => rt.ThrowOrValue<string[]>());
public long PubSubNumSub(string channel) => Call("PUBSUB".SubCommand("NUMSUB").Input(channel), rt => rt.ThrowOrValue((a, _) => a.MapToList((x, y) => y.ConvertTo<long>()).FirstOrDefault()));
public long[] PubSubNumSub(string[] channels) => Call("PUBSUB".SubCommand("NUMSUB").Input(channels), rt => rt.ThrowOrValue((a, _) => a.MapToList((x, y) => y.ConvertTo<long>()).ToArray()));
public long PubSubNumPat(string message) => Call("PUBLISH".SubCommand("NUMPAT").InputRaw(message), rt => rt.ThrowOrValue<long>());
public long PubSubNumPat() => Call("PUBLISH".SubCommand("NUMPAT"), rt => rt.ThrowOrValue<long>());


public void PUnSubscribe(params string[] pattern) => _pubsub.UnSubscribe(true, pattern);
Expand Down

0 comments on commit d01177c

Please sign in to comment.