Code Monkey home page Code Monkey logo

redpubsub's People

Contributors

artpolikarpov avatar dntst avatar wilddeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redpubsub's Issues

what i'm doing wrong ?

Sorry my bad english.
i write small test app:
server.js

RPS.config.Messages = {
    fetchFields: ['clientId'],
    channels: function (selector, fields) {
        return 'messageToClientId:' + fields.clientId ;
    }
};

Meteor.publish('messages', function (clientId) {
    RPS.publish(this, {
        collection: Messages,
        options: {
            selector: {clientId: clientId},
            channel: 'messageToClientId:' + clientId
        }
    });
});

client.js

    Meteor.startup(function () {
        var clientId = localStorage.getItem('clientID') ;
        if(clientId) {
            Session.set('myID', clientId);
        } else {
            clientId = Random.id() ;
            localStorage.setItem('clientID', clientId);
            Session.set('myID', clientId);
        }
        Meteor.subscribe('messages', clientId);
    });

    Template.hello.helpers({
        chatData: function(){
            return Messages.find();
        },
        clientId: function(){
            return Session.get('myID');
        }
    });

    Template.hello.events({
        'submit form': function(event, template) {
            event.preventDefault();
            var toClient = template.find('#clientID').value;
            var msg = template.find('#message').value;
            RPS.write(Messages, 'insert', {
                doc: {
                    message: msg,
                    ts: Date.now(),
                    clientId: toClient,
                    fromClient: Session.get('myID')
                }
            });
        }
    });

After submit form mongo create new record in Message collection.
But this new record does not appear in other client, subscription is not working.
Record appears only after the page is updated.
What i'm doing wrong?

When withoutMongo, records still require an id, or they silently fail.

Turns out when trying to tie in a pub/sub using withoutMongo: true, our messages never get sent out again to subscribers, yet a manual PSUBSCRIBE in redis on the same channel picked them up fine. We later discovered the cause was not having an id on the original message object.

The offending line from observe-changes.js:

ids = !message.id || _.isArray(message.id) ? message.id : [message.id];

I've made an id from our specific use case, but can we please add some validation and / or remove the requirement for an id (object hash + timestamp + rand() ?) in this scenario please?

meteor not updating from 1.10.2

=> Errors while initializing project:

While selecting package versions:
error: No version of ddp-server satisfies all constraints: @=2.3.1, @~2.4.0
Constraints on package "ddp-server":

  • ddp-server@=2.3.1 <- top level
  • ddp-server@~2.4.0 <- top level
  • [email protected] <- ddp 1.4.0 <- accounts-base 2.0.0 <- accounts-password 2.0.0
  • [email protected] <- ddp 1.4.0 <- accounts-password 2.0.0

Drop-in replacement

What about doing things like overriding Meteor.publish? I.e. So the interface is the same as what you are used to. Could you use your system completely in place of Meteor's?

What are the caveats? Why did meteor not pursue this implementation to begin with and instead chose LiveQuery?

How to use a failover url?

If the redis url does not work, this package crashes the app and causes the meteor container on galaxy I have deployed to keep restarting.

First does it have to crash the app if the url does not work?

Second, is there a way to specify a failover url?

Any advice in this regards would be greatly appreciated! Thanks

Some questions

Hello guys I believe this is an awesome package. We began working on something similar: https://github.com/cult-of-coders/redis-oplog without knowing there was work done in this direction. So we had to re-invent some stuff. However I looked through your code and I love it. Would you be interested in discussing more about this ?

Example

Please, write small example how it works.
Thanks )

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.