ClusterSubscriber.d.ts 886 B

1234567891011121314151617181920212223242526272829
  1. /// <reference types="node" />
  2. import { EventEmitter } from "events";
  3. import ConnectionPool from "./ConnectionPool";
  4. export default class ClusterSubscriber {
  5. private connectionPool;
  6. private emitter;
  7. private isSharded;
  8. private started;
  9. private subscriber;
  10. private lastActiveSubscriber;
  11. private slotRange;
  12. constructor(connectionPool: ConnectionPool, emitter: EventEmitter, isSharded?: boolean);
  13. getInstance(): any;
  14. /**
  15. * Associate this subscriber to a specific slot range.
  16. *
  17. * Returns the range or an empty array if the slot range couldn't be associated.
  18. *
  19. * BTW: This is more for debugging and testing purposes.
  20. *
  21. * @param range
  22. */
  23. associateSlotRange(range: number[]): number[];
  24. start(): void;
  25. stop(): void;
  26. isStarted(): boolean;
  27. private onSubscriberEnd;
  28. private selectSubscriber;
  29. }