It may seem a bit abstract, so perhaps an example is in order: The other Parsers in the Sink are called upon to process the data returned from a command. In each Sink, one of the interfaces is always an ErrorParser, since most/all Redis commands can return an error. Sinks are composed of two or more Parser interfaces. For lack of a better name, we call these the Sink interfaces (as in source/sink). Rather, they are interfaces designed to handle the set of data types that Redis supports. Sending CommandsĮvery command method in Phants Client for Redis is asynchronous, meaning you'll essentially provide a callback responsible for processing the result. The caller can provide a callback to Disconnect(), and other interested parties can register for disconnect events. This is the standard Redis port if you've changed the defaults, you'll obviously have to adjust for your setup.ĭisconnects are done in the same fashion. In any event, you'll connect to Redis on port number 6379. This is likely an easier way to test rather than jumping right into Unity. This will allow you to try out some raw Redis commands to ensure that everything is ready to go. With your server up and running, you should be able to connect any number of ways with simple tools like netcat or telnet.
You may have to open access to this port. This is especially true when running a Redis server on Windows, as the Windows firewall typically prevents access to port 6379 by default. You may have difficulty connecting if there is a firewall involved. If this is the case, some commands (and hence, CommandClient methods) will not work the server simply will not recognize them as valid commands. While Phants Client for Redis implements nearly every command up to version 5.0, your server may not. Each entry in the Command Reference notes the version where the command became available (e.g. New commands are added with each version of Redis. If you are using this client, you probably already have some idea of what you need and how you want to run it.
#REDIS WINDOWS CLIENT FREE WINDOWS 10#
This client has been tested against Redis servers running on Ubuntu server, Raspberry Pi, and the Windows 10 WSL. This is often as simple as using apt-get on a Linux box. Getting Startedįirst thing's first, you're going to need a Redis server of some sort. To learn more about the underlying Redis data types, see the Redis Protocol specification. You are encouraged to check out the Redis Command Reference, as well as Redis Pub/Sub to get the most out of this package. Here you will find, for example, everything you need to know to call the BzpopMin() method, but the behavior of the BZPOPMIN command itself is not described. These pages serve only to document the API provided by the client software, which simply creates a (nearly one-to-one) mapping between C# methods and Redis server commands.
While it is certainly possible to create one client that jumps between these modes, we opted for a simpler approach: use SubscriptionClient if you want subscription events, and use CommandClient if you want to send commands. Modes of Operationįrom a Redis server's perspective, clients have two fundamentally different states or modes of operation: Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. Phants Client for Redis is a Redis client implementation written in C# for Unity.