Commit 7e45a27f authored by Marc Gravell's avatar Marc Gravell

Readme and license

parent f59f06ff
...@@ -31,4 +31,16 @@ information can be viewed here: http://redis.io/topics/license ...@@ -31,4 +31,16 @@ information can be viewed here: http://redis.io/topics/license
This tool makes use of the "redis doc" library from http://redis.io/documentation This tool makes use of the "redis doc" library from http://redis.io/documentation
in the intellisense comments; the license for this library is under discussion in the intellisense comments; the license for this library is under discussion
at time of writing; if this concludes such that this usage is inappropriate, at time of writing; if this concludes such that this usage is inappropriate,
the intellisense comments will be rewriteen. the intellisense comments will be rewriteen.
\ No newline at end of file
The development solution uses the Redis-64 package from nuget
(https://www.nuget.org/packages/Redis-64) by Microsoft Open Technologies, inc.
This is licensed under the BSD license; full details are available here:
https://github.com/MSOpenTech/redis/blob/2.6/license.txt
This tool is not used in the release binaries.
The development solution uses the BookSleeve package from nuget
(https://code.google.com/p/booksleeve/) by Marc Gravell. This is licensed
under the Apache 2.0 license; full details are available here:
http://www.apache.org/licenses/LICENSE-2.0
This tool is not used in the release binaries.
\ No newline at end of file
...@@ -33,6 +33,12 @@ The central object in StackExchange.Redis is the `ConnectionMultiplexer` class i ...@@ -33,6 +33,12 @@ The central object in StackExchange.Redis is the `ConnectionMultiplexer` class i
Note that `ConnectionMultiplexer` implements `IDisposable` and can be disposed when no longer required, but I am deliberately not showing `using` statement usage, because it is exceptionally rare that you would want to use a `ConnectionMultiplexer` briefly, as the idea is to re-use this object. Note that `ConnectionMultiplexer` implements `IDisposable` and can be disposed when no longer required, but I am deliberately not showing `using` statement usage, because it is exceptionally rare that you would want to use a `ConnectionMultiplexer` briefly, as the idea is to re-use this object.
A more complicated scenario might involve a master/slave setup; for this usage, simply specify all the desired nodes that make up that logical redis tier (it will automatically identify the master):
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("server1:6379,server2:6379");
If it finds both nodes are masters, a tie-breaker key can optionally be specified that can be used to resolve the issue, however such a condition is fortunately very rare.
Once you have a `ConnectionMultiplexer`, there are 3 main things you might want to do: Once you have a `ConnectionMultiplexer`, there are 3 main things you might want to do:
- access a redis database (note that in the case of a cluster, a single logical database may be spread over multiple nodes) - access a redis database (note that in the case of a cluster, a single logical database may be spread over multiple nodes)
...@@ -74,7 +80,7 @@ The entire range of [redis database commands](http://redis.io/commands) covering ...@@ -74,7 +80,7 @@ The entire range of [redis database commands](http://redis.io/commands) covering
Using redis pub/sub Using redis pub/sub
---- ----
Another common use of redis is as a pub/sub message distribution node; this too is simple, and in the event of connection failure, the `ConnectionMultiplexer` will handle all the details of re-subscribing to the requested channels. Another common use of redis is as a [pub/sub message](http://redis.io/topics/pubsub) distribution tool; this too is simple, and in the event of connection failure, the `ConnectionMultiplexer` will handle all the details of re-subscribing to the requested channels.
ISubscriber sub = redis.GetSubscriber(); ISubscriber sub = redis.GetSubscriber();
...@@ -113,7 +119,7 @@ There are 3 primary usage mechanisms with StackExchange.Redis: ...@@ -113,7 +119,7 @@ There are 3 primary usage mechanisms with StackExchange.Redis:
- Synchronous - where the operation completes before the methods returns to the caller (note that while this may block the caller, it absolutely **does not** block other threads: the key idea in StackExchange.Redis is that it aggressively shares the connection between concurrent callers) - Synchronous - where the operation completes before the methods returns to the caller (note that while this may block the caller, it absolutely **does not** block other threads: the key idea in StackExchange.Redis is that it aggressively shares the connection between concurrent callers)
- Asynchronous - where the operation completes some time in the future, and a `Task` or `Task<T>` is returned immediately, which can later: - Asynchronous - where the operation completes some time in the future, and a `Task` or `Task<T>` is returned immediately, which can later:
- be *waited* (blocking the current thread until the response is available) - be `.Wait()`ed (blocking the current thread until the response is available)
- have a continuation callback added ([`ContinueWith`](http://msdn.microsoft.com/en-us/library/system.threading.tasks.task.continuewith(v=vs.110).aspx) in the TPL) - have a continuation callback added ([`ContinueWith`](http://msdn.microsoft.com/en-us/library/system.threading.tasks.task.continuewith(v=vs.110).aspx) in the TPL)
- be *awaited* (which is a language-level feature that simplfies the latter, while also continuing immediately if the reply is already known) - be *awaited* (which is a language-level feature that simplfies the latter, while also continuing immediately if the reply is already known)
- Fire-and-Forget - where you really aren't interested in the reply, and are happy to continue irrespective of the response - Fire-and-Forget - where you really aren't interested in the reply, and are happy to continue irrespective of the response
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment