Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster does not work on Galaxy #111

Open
guns2410 opened this issue Jan 21, 2016 · 0 comments
Open

Cluster does not work on Galaxy #111

guns2410 opened this issue Jan 21, 2016 · 0 comments

Comments

@guns2410
Copy link

I have observed that meteorhacks:cluster does not work on galaxy dev edition (and also with the production version). I have an application running 7 different micro-services powering a single application. I have been working on making the servers talk to each other over DDP using cluster and it was preety easy on AWS and Digital Ocean.

I wish apart from Loadbalancing, Cluster could be used on Galaxy for DDP connections.

DDPConnector = function (url, options = {}) {
    this.url = url;
    this.ddpOptions = options.ddpOptions || {};
    this.timeout = options.timeout || 5 * 1000;

    this.connection = DDP.connect(this.url, this.ddpOptions);
    this.connection.disconnect();
    this.startConnecting();
}

DDPConnector.prototype.getConnection = function () {
    return this.connection;
}

DDPConnector.prototype.getUrl = function () {
    return this.url;
}

DDPConnector.prototype.startConnecting = function () {
    var self = this;
    var connected = false;
    setConnectionIfNeeded();

    this.timeoutHandler = Meteor.setInterval(setConnectionIfNeeded, self.timeout);

    function setConnectionIfNeeded () {
        var status = self.connection.status();
        var isOffline = connected && status.status == "offline";
        if (!status.connected && !isOffline) {
            self.connection.reconnect({ url: self.url });
            connected = true;
        }
    }
}

DDPConnector.prototype.stop = function () {
    Meteor.clearTimeout(this.timeoutHandler);
}

This is what i have incorporated temporarily removing Cluster. I know this code would be buggy but i really hope that we have meteorhacks:cluster work on Galaxy..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant