import { createClient , RedisClient } from 'redis' ; export class Publisher < T > { private client : RedisClient ; constructor ( redisUrl ) { this . client = createClient ( { url : redisUrl } ) ; } async publish ( topic , msg ) { this . client . publish ( topic , JSON . stringify ( msg ) ) ; } }