@restorecommerce/chassis-srv
Version:
Restore Commerce microservice chassis
41 lines (40 loc) • 1.14 kB
TypeScript
import { Events, Topic } from '@restorecommerce/kafka-client';
import { RedisClientType } from 'redis';
import { Logger } from 'winston';
/**
* Stores the offsets of the provided topics to redis periodically
*/
export declare class OffsetStore {
logger: Logger;
config: any;
kafkaEvents: Events;
redisClient: RedisClientType<any, any>;
topics: any;
timerID: any;
constructor(events: Events, config: any, logger: Logger);
/**
* updates the topic offset in redis periodically
*
*/
updateTopicOffsets(): any;
/**
* stores the offset to redis
* @param {object} topic Topic object
* @param {object} redisClient
* @return {object}
*/
storeOffset(topic: Topic, topicName: string): Promise<any>;
/**
* get the offset value for the topic from redis
* @param {string} topic Topic name
* @return {object}
*/
getOffset(topicName: string): Promise<number>;
/**
* stops the redis client
* @param {object} topic Topic object
* @param {object} redisClient
* @return {object}
*/
stop(): Promise<any>;
}