Meteors
Smart wrapper for server-to-server(s) DDP.connect()
.
Meteors.register(appName, {instanceUrl})
Use it on «server» servers to register the app:
// instance #1 setup Meteors.registerInstance('search', {instanceUrl: 'http://search-01.private/'});
If you have more than one instance for the same app, run this code on every instance:
// instance #2 setup Meteors.registerInstance('search', {instanceUrl: 'http://search-02.private/'});
Meteors.connect(appName)
Use it on «client» server to connect to the remote Meteor app:
let Search = Meteors.connect('search');
Then call methods normally:
let searchResults = Search.call('superDupperSeach', {q: '%D1%85%D1%83%D0%B9'});
Meteors.connect
is smart enough to balance instances and reconnect if needed.