Add partitioning logic
This commit is contained in:
parent
5f773d46c9
commit
77465e6b49
6 changed files with 168 additions and 0 deletions
15
src/io/cluster/partitionclusterclient.js
Normal file
15
src/io/cluster/partitionclusterclient.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import Promise from 'bluebird';
|
||||
|
||||
class PartitionClusterClient {
|
||||
constructor(partitionDecider) {
|
||||
this.partitionDecider = partitionDecider;
|
||||
}
|
||||
|
||||
getSocketConfig(channel) {
|
||||
return Promise.resolve({
|
||||
servers: this.partitionDecider.getPartitionForChannel(channel)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { PartitionClusterClient };
|
||||
Loading…
Add table
Add a link
Reference in a new issue