{"repo":"jgaskins/redis","free":true,"listed":false,"github":"https://github.com/jgaskins/redis","clone":"git clone https://github.com/jgaskins/redis.git","description":"Pure-Crystal Redis client, supporting clustering, RedisJSON, RediSearch, and RedisTimeSeries","language":"Crystal","stars":78,"topics":["crystal-lang","redis","redis-client","crystal","redis-cluster","redis-timeseries","redisearch","redis-json","redisjson","redistimeseries"],"license":"MIT","category":"databases-storage","readme_excerpt":"redis A pure-Crystal implementation of the Redis protocol Installation 1. Add the dependency to your shard.yml : 2. Run shards Usage Pipelined queries To mitigate latency with multiple queries whose inputs and outputs are completely independent of each other, you can \"pipeline\" your queries by sending them all at once before reading them. To do this, you can use the pipeline method: The return value of pipeline will be an array containing the values of each of those calls in the order they were sent. So in this case, it might be [1, nil, 2] to match the return values of incr , set , and lpush , respectively. Transactions The Redis MULTI command begins a transaction, so you can use the multi method to execute a transaction against the server: The transaction is automatically committed with EXEC at the end of the block. If an exception occurs within the block, the transaction will be rolled back with DISCARD before exiting the block. You may also call txn.discard , which will effectively disable the transaction (all further methods called on the transaction do nothing), but will not exit the block. You will need to exit the block explicitly with break if there are operations within the block that cannot be rolled back, such as sending an email or sending a request to a third-party API. The reason for this is that the only way to exit a containing block from an inner method in Crystal is to raise an exception, and this library chooses not to use exceptions for flow control. Beyo","default_branch":null,"files":null,"tree":[],"storefront":"/r/jgaskins","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jgaskins/redis/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}