GithubHelp home page GithubHelp logo

Prepare a demo for y-redis about y-redis HOT 15 CLOSED

yjs avatar yjs commented on May 27, 2024 13
Prepare a demo for y-redis

from y-redis.

Comments (15)

sdzhu avatar sdzhu commented on May 27, 2024 4

in your y-websocket repo, modify bin/utils.js like this
//use y-redis
const redisConfig = {
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT,
password: process.env.REDIS_PASSWORD,
db: process.env.REDIS_DB,
keyPrefix: process.env.REDIS_KEY_PREFIIX
}

const rp = new RedisPersistence({redisOpts: redisConfig})
persistence = {
provider: rp,
bindState: async (docName, ydoc) => {
rp.closeDoc(docName)
return rp.bindState(docName, ydoc)
},
writeState: async (docName, ydoc) => {}
}

from y-redis.

rchrd2 avatar rchrd2 commented on May 27, 2024 2

An example in the README on how to use and configure this would be very helpful.

from y-redis.

TannerW avatar TannerW commented on May 27, 2024 2

Any updates on this?

from y-redis.

bionicles avatar bionicles commented on May 27, 2024

I'd use it! just some basic usage example would be clutch

from y-redis.

dmonad avatar dmonad commented on May 27, 2024

Hi @bionicles , thanks for your interest! Just a heads up: Unfortunately, I currently don't have time to work on it. If you are willing to, I'd be happy to help you out if you contribute to this repository.

from y-redis.

bionicles avatar bionicles commented on May 27, 2024

sure, I love me some Redis, and CRDTs are fascinating.

Question:

  const redis = new Redis()
  await redis.flushall()
  {
    const redisPersistence = new RedisPersistence()

how does RedisPersistence find out about Redis?

from y-redis.

dmonad avatar dmonad commented on May 27, 2024

You set the address as a parameter of the RedisPersistence (the default is localhost)

from y-redis.

chanced avatar chanced commented on May 27, 2024

@dmonad it may make more sense to either accept a factory for redis/cluster clients or 2 instances rather than the configs.

I think its a bit more clear and helps with testing / separation of concerns.

from y-redis.

ahoyahoy avatar ahoyahoy commented on May 27, 2024

+1
please!

from y-redis.

datzun avatar datzun commented on May 27, 2024

+1

from y-redis.

appletea233 avatar appletea233 commented on May 27, 2024

plz +1

from y-redis.

petru-planable avatar petru-planable commented on May 27, 2024

+1

from y-redis.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.