This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf-8') | |
await asyncio.gather( | |
publish(redis, 1, 'Possible vocalizations east of Makanda'), | |
publish(redis, 2, 'Sighting near the Columbia River'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
from pprint import pp | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf-8') | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
async def main(): | |
redis = await aioredis.create_redis('redis://:foobared@localhost:6379/0', encoding='utf-8') | |
await asyncio.gather( | |
add_to_queue(redis, 'Possible vocalizations east of Makanda'), | |
add_to_queue(redis, 'Sighting near the Columbia River'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let redis = new Redis() | |
async function classinate(values) { | |
await redis.call( | |
'AI.TENSORSET', 'model:in', | |
'DOUBLE', '1', '10', | |
'VALUES', ...values) | |
await redis.call( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guyroyse.blogs.lettucevsjedis; | |
import redis.clients.jedis.Jedis; | |
import redis.clients.jedis.Pipeline; | |
import redis.clients.jedis.Response; | |
import redis.clients.jedis.Tuple; | |
import java.util.Set; | |
import java.util.stream.Collectors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guyroyse.blogs.lettucevsjedis; | |
import redis.clients.jedis.Jedis; | |
public class JedisSetGet { | |
private static final String YOUR_CONNECTION_STRING = "redis://:foobared@yourserver:6379/0"; | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guyroyse.blogs.lettucevsjedis; | |
import io.lettuce.core.RedisClient; | |
import io.lettuce.core.api.StatefulRedisConnection; | |
import io.lettuce.core.api.async.RedisAsyncCommands; | |
public class LettuceAsync { | |
private static final String YOUR_CONNECTION_STRING = "redis://:foobared@yourserver:6379/0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guyroyse.blogs.lettucevsjedis; | |
import io.lettuce.core.RedisClient; | |
import io.lettuce.core.api.StatefulRedisConnection; | |
import io.lettuce.core.api.sync.RedisCommands; | |
public class LettuceSetGet { | |
private static final String YOUR_CONNECTION_STRING = "redis://:foobared@yourserver:6379/0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guyroyse.blogs.lettucevsjedis; | |
import redis.clients.jedis.*; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class JedisMultithreaded { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from redisbloom.client import Client | |
client = Client() | |
client.topkReserve('ufo_words', k=10, width=400, | |
depth=10, decay=0.9) | |
# lots of code to get some words... | |
[client.topkAdd('ufo_words', w) for w in words] |