Code Monkey home page Code Monkey logo

Comments (7)

habibrosyad avatar habibrosyad commented on September 25, 2024 4

I've setup a demo on my experiments for this in https://habibrosyad.github.io/yorkie-js-sdk/ (Quill demo with peers), where you could set your own username with query param username in the link (otherwise it's randomly generated).

To add peer details, I use an additional meta field (basically a Map<string,string>) when creating a client. In this field you could put whatever details related with the client there. The meta then persisted during client activation and can be fetched later during the documents-watching-peer-changed event. To accommodate this I've modified the proto a bit.

This is just a rough experiment, and I'm not sure yet that this is an ideal approach. The changes that I've made for this can be seen in habibrosyad/yorkie@14ed7e1 and habibrosyad@0111683.

from yorkie-js-sdk.

habibrosyad avatar habibrosyad commented on September 25, 2024 2

@habibrosyad
Thanks to your help, we have added metadata to the Peer Awareness. And I am working on a related design document. Can you review the document? yorkie-team/yorkie#139

sure 👍

from yorkie-js-sdk.

habibrosyad avatar habibrosyad commented on September 25, 2024 1

@hackerwins I think I've got a better approach than the previous one. I play around with the WatchDocuments. Instead of persisting meta during client activation (and saving it in the db), I pass it as part of the WatchDocumentsRequest. The peer id and meta become the value of the event documents-watching-peer-changed (changed from list of peer ids into map of <peer id, peer meta>). Also, I removed the GetClients because it is not needed anymore.

The changes made for this can be seen here in yorkie and yorkie-js-sdk. Should I make a PR for this issue?

from yorkie-js-sdk.

hackerwins avatar hackerwins commented on September 25, 2024

The peer awareness feature is not yet fully implemented. We were thinking about how to pass additional information of the client. Since Yorkie is not yet released to users, we are trying to design an API while implementing an example(CodePair). Do you have any good ideas?

from yorkie-js-sdk.

hackerwins avatar hackerwins commented on September 25, 2024

@habibrosyad
Thank you for explaining the experiment. Storing metadata on the client seems like a good approach. I think we may refer to this experiment and implement it.

While looking at the experiment, I was wondering how to get client meta info from WatchDocuments without calling rpc GetClients().

from yorkie-js-sdk.

hackerwins avatar hackerwins commented on September 25, 2024

@habibrosyad Cool! 👍 It seems to be much lighter than the previous approach. If you create PRs(yorkie and yorkie-js-sdk), I will review it with other members.

from yorkie-js-sdk.

hackerwins avatar hackerwins commented on September 25, 2024

@habibrosyad
Thanks to your help, we have added metadata to the Peer Awareness. And I am working on a related design document. Can you review the document? yorkie-team/yorkie#139

from yorkie-js-sdk.

Related Issues (20)

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.