Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");
publisher.publish("test", "haaaaai");
publisher.publish("test", "kthxbai");
@SusmitLight

This comment has been minimized.

Copy link

@SusmitLight SusmitLight commented Nov 13, 2017

hi

@DeanDonkov

This comment has been minimized.

Copy link

@DeanDonkov DeanDonkov commented Mar 17, 2018

hi

@Pingue

This comment has been minimized.

Copy link

@Pingue Pingue commented Mar 19, 2018

hi

@dgTzion

This comment has been minimized.

Copy link

@dgTzion dgTzion commented Mar 20, 2018

hi

@vkakde

This comment has been minimized.

Copy link

@vkakde vkakde commented Mar 21, 2018

hi

@IlyaVorozhbit

This comment has been minimized.

Copy link

@IlyaVorozhbit IlyaVorozhbit commented Mar 30, 2018

You all here so original

@Vaflan

This comment has been minimized.

Copy link

@Vaflan Vaflan commented Apr 4, 2018

hi

@ochanje210

This comment has been minimized.

Copy link

@ochanje210 ochanje210 commented Apr 25, 2018

hi

@MetinSeylan

This comment has been minimized.

Copy link

@MetinSeylan MetinSeylan commented Apr 29, 2018

hi

@kawache

This comment has been minimized.

Copy link

@kawache kawache commented May 2, 2018

hi

@keysim

This comment has been minimized.

Copy link

@keysim keysim commented May 18, 2018

hi

@pito-svk

This comment has been minimized.

Copy link

@pito-svk pito-svk commented May 24, 2018

hi

@wangleihd

This comment has been minimized.

Copy link

@wangleihd wangleihd commented May 28, 2018

hi

@JirapusNon

This comment has been minimized.

Copy link

@JirapusNon JirapusNon commented May 31, 2018

hi

@liogate

This comment has been minimized.

Copy link

@liogate liogate commented Jun 1, 2018

hi

@ifedapoolarewaju

This comment has been minimized.

Copy link

@ifedapoolarewaju ifedapoolarewaju commented Jun 9, 2018

hi

@kripplek

This comment has been minimized.

Copy link

@kripplek kripplek commented Jun 14, 2018

hi

@burtontanner

This comment has been minimized.

Copy link

@burtontanner burtontanner commented Jun 19, 2018

hi

@v29neil

This comment has been minimized.

Copy link

@v29neil v29neil commented Jun 20, 2018

hi

@sadeghmohebbi

This comment has been minimized.

Copy link

@sadeghmohebbi sadeghmohebbi commented Jun 22, 2018

hi

@TerryJ2

This comment has been minimized.

Copy link

@TerryJ2 TerryJ2 commented Jun 29, 2018

hi

@swift-nicholas

This comment has been minimized.

Copy link

@swift-nicholas swift-nicholas commented Jul 9, 2018

hi

@vinhjaxt

This comment has been minimized.

Copy link

@vinhjaxt vinhjaxt commented Jul 11, 2018

hi

@Krychle

This comment has been minimized.

Copy link

@Krychle Krychle commented Jul 11, 2018

hi

@Shiroh1ge

This comment has been minimized.

Copy link

@Shiroh1ge Shiroh1ge commented Jul 11, 2018

hi

@zerefel

This comment has been minimized.

Copy link

@zerefel zerefel commented Jul 11, 2018

hi

@vitya1

This comment has been minimized.

Copy link

@vitya1 vitya1 commented Jul 13, 2018

hi

@xm66778899

This comment has been minimized.

Copy link

@xm66778899 xm66778899 commented Jul 17, 2018

hi

@risyasin

This comment has been minimized.

Copy link

@risyasin risyasin commented Jul 20, 2018

hi

@erencelik

This comment has been minimized.

Copy link

@erencelik erencelik commented Jul 20, 2018

hi

@algun

This comment has been minimized.

Copy link

@algun algun commented Jul 20, 2018

hi

@mabel

This comment has been minimized.

Copy link

@mabel mabel commented Jul 22, 2018

yo

@jejegraille

This comment has been minimized.

Copy link

@jejegraille jejegraille commented Jul 24, 2018

yo

@Triforcey

This comment has been minimized.

Copy link

@Triforcey Triforcey commented Jul 27, 2018

yo

@wanglong167

This comment has been minimized.

Copy link

@wanglong167 wanglong167 commented Jul 28, 2018

lol

@JiveOff

This comment has been minimized.

Copy link

@JiveOff JiveOff commented Jul 29, 2018

hi

@guerrato

This comment has been minimized.

Copy link

@guerrato guerrato commented Jul 30, 2018

hi

@riverleo

This comment has been minimized.

Copy link

@riverleo riverleo commented Aug 3, 2018

hi

@gecatalin

This comment has been minimized.

Copy link

@gecatalin gecatalin commented Aug 4, 2018

hi

@HapLifeMan

This comment has been minimized.

Copy link

@HapLifeMan HapLifeMan commented Aug 4, 2018

hi

@slaveofcode

This comment has been minimized.

Copy link

@slaveofcode slaveofcode commented Aug 8, 2018

hi

@matzero

This comment has been minimized.

Copy link

@matzero matzero commented Aug 9, 2018

hi

@AndikaR

This comment has been minimized.

Copy link

@AndikaR AndikaR commented Aug 14, 2018

hi

@MedFBoudis

This comment has been minimized.

Copy link

@MedFBoudis MedFBoudis commented Aug 14, 2018

hi

@andychisholm

This comment has been minimized.

Copy link

@andychisholm andychisholm commented Aug 20, 2018

hi

@Yar0myr

This comment has been minimized.

Copy link

@Yar0myr Yar0myr commented Aug 21, 2018

hi

@vip3r011

This comment has been minimized.

Copy link

@vip3r011 vip3r011 commented Aug 25, 2018

kthxbai

@solohin

This comment has been minimized.

Copy link

@solohin solohin commented Aug 26, 2018

hi

@ph55

This comment has been minimized.

Copy link

@ph55 ph55 commented Aug 29, 2018

allo

@VBetsun

This comment has been minimized.

Copy link

@VBetsun VBetsun commented Sep 9, 2018

hi

@cnra

This comment has been minimized.

Copy link

@cnra cnra commented Sep 10, 2018

hello

@yalopov

This comment has been minimized.

Copy link

@yalopov yalopov commented Sep 10, 2018

hi desu

@antojsh

This comment has been minimized.

Copy link

@antojsh antojsh commented Sep 12, 2018

Hi

@0xAnakin

This comment has been minimized.

Copy link

@0xAnakin 0xAnakin commented Sep 28, 2018

Aloha

@U-siro

This comment has been minimized.

Copy link

@U-siro U-siro commented Sep 29, 2018

Ayaya

@cdgriffith

This comment has been minimized.

Copy link

@cdgriffith cdgriffith commented Oct 3, 2018

hi

@vizo

This comment has been minimized.

Copy link

@vizo vizo commented Oct 4, 2018

heluuuuuu

@spoulson

This comment has been minimized.

Copy link

@spoulson spoulson commented Oct 5, 2018

hi

@v29neil

This comment has been minimized.

Copy link

@v29neil v29neil commented Oct 10, 2018

hi

@kerus1024

This comment has been minimized.

Copy link

@kerus1024 kerus1024 commented Oct 15, 2018

hi

@ZerglingGo

This comment has been minimized.

Copy link

@ZerglingGo ZerglingGo commented Oct 15, 2018

hi

@arnasledev

This comment has been minimized.

Copy link

@arnasledev arnasledev commented Oct 16, 2018

hi

@kyting

This comment has been minimized.

Copy link

@kyting kyting commented Oct 19, 2018

haaaaai

@bludrate

This comment has been minimized.

Copy link

@bludrate bludrate commented Oct 20, 2018

hi

@boygiandi

This comment has been minimized.

Copy link

@boygiandi boygiandi commented Oct 23, 2018

hi

@apmcodes

This comment has been minimized.

Copy link

@apmcodes apmcodes commented Oct 25, 2018

HI

@redsand

This comment has been minimized.

Copy link

@redsand redsand commented Oct 29, 2018

hi

@AtotheY

This comment has been minimized.

Copy link

@AtotheY AtotheY commented Nov 1, 2018

hi

@joshhills

This comment has been minimized.

Copy link

@joshhills joshhills commented Nov 4, 2018

hi

@dukuo

This comment has been minimized.

Copy link

@dukuo dukuo commented Nov 6, 2018

hi

@QuyetNT

This comment has been minimized.

Copy link

@QuyetNT QuyetNT commented Nov 9, 2018

Viet Nam say Hi

@Kaptard

This comment has been minimized.

Copy link

@Kaptard Kaptard commented Nov 12, 2018

hi

@nmvuong92

This comment has been minimized.

Copy link

@nmvuong92 nmvuong92 commented Nov 22, 2018

hi

@superposition

This comment has been minimized.

Copy link

@superposition superposition commented Nov 24, 2018

hi

@franck34

This comment has been minimized.

Copy link

@franck34 franck34 commented Nov 24, 2018

hi

@arturz

This comment has been minimized.

Copy link

@arturz arturz commented Nov 27, 2018

hi

@MozyOk

This comment has been minimized.

Copy link

@MozyOk MozyOk commented Nov 27, 2018

Hi

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Nov 28, 2018

hi

@superhero

This comment has been minimized.

Copy link

@superhero superhero commented Nov 28, 2018

hi

@borbalher

This comment has been minimized.

Copy link

@borbalher borbalher commented Nov 29, 2018

hi

@abhijitghogre

This comment has been minimized.

Copy link

@abhijitghogre abhijitghogre commented Dec 9, 2018

hi

@ksidpen

This comment has been minimized.

Copy link

@ksidpen ksidpen commented Dec 11, 2018

hi

@Justkog

This comment has been minimized.

Copy link

@Justkog Justkog commented Dec 13, 2018

hi

@JuneJobs

This comment has been minimized.

Copy link

@JuneJobs JuneJobs commented Dec 17, 2018

hi

@GuillermoFarias

This comment has been minimized.

Copy link

@GuillermoFarias GuillermoFarias commented Dec 19, 2018

hi

@kMeillet

This comment has been minimized.

Copy link

@kMeillet kMeillet commented Dec 20, 2018

hi

@VicoErv

This comment has been minimized.

Copy link

@VicoErv VicoErv commented Dec 21, 2018

hi

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Dec 21, 2018

hi

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Dec 23, 2018

he

@Matthcw

This comment has been minimized.

Copy link

@Matthcw Matthcw commented Dec 25, 2018

hi

@blixxurd

This comment has been minimized.

Copy link

@blixxurd blixxurd commented Jan 1, 2019

hi

@agupta1989

This comment has been minimized.

Copy link

@agupta1989 agupta1989 commented Jan 8, 2019

WTF ! 😆

@shaharpan2912

This comment has been minimized.

Copy link

@shaharpan2912 shaharpan2912 commented Jan 9, 2019

hi

@icastillejogomez

This comment has been minimized.

Copy link

@icastillejogomez icastillejogomez commented Jan 9, 2019

LOOL

@fxpoet

This comment has been minimized.

Copy link

@fxpoet fxpoet commented Jan 9, 2019

hi

@juniarta

This comment has been minimized.

Copy link

@juniarta juniarta commented Jan 10, 2019

hi

@colinskow

This comment has been minimized.

Copy link

@colinskow colinskow commented Jan 16, 2019

Yo, I was searching for a pub where I can drink a beer and eat a sub. Obviously I've come to the wrong club.

@theSupermacy

This comment has been minimized.

Copy link

@theSupermacy theSupermacy commented Jan 21, 2019

@colinskow nice one!!

@bigbear1989

This comment has been minimized.

Copy link

@bigbear1989 bigbear1989 commented Jan 22, 2019

привет

@veliksergey

This comment has been minimized.

Copy link

@veliksergey veliksergey commented Jan 25, 2019

hi

@zanderzone

This comment has been minimized.

Copy link

@zanderzone zanderzone commented Jan 28, 2019

hai

@drZloy

This comment has been minimized.

Copy link

@drZloy drZloy commented Jan 30, 2019

hi

@kakopappa

This comment has been minimized.

Copy link

@kakopappa kakopappa commented Feb 10, 2019

hi

@slayerulan

This comment has been minimized.

Copy link

@slayerulan slayerulan commented Feb 10, 2019

hi

@mandaputtra

This comment has been minimized.

Copy link

@mandaputtra mandaputtra commented Feb 12, 2019

213

@db2crush

This comment has been minimized.

Copy link

@db2crush db2crush commented Feb 14, 2019

hi

@amanp9711

This comment has been minimized.

Copy link

@amanp9711 amanp9711 commented Feb 14, 2019

hi

@javarouka

This comment has been minimized.

Copy link

@javarouka javarouka commented Feb 15, 2019

hi

@stazeworks

This comment has been minimized.

Copy link

@stazeworks stazeworks commented Feb 17, 2019

hm

@snutiise

This comment has been minimized.

Copy link

@snutiise snutiise commented Feb 19, 2019

hi

@tuapuikia

This comment has been minimized.

Copy link

@tuapuikia tuapuikia commented Feb 22, 2019

hi

@arthursalvtr

This comment has been minimized.

Copy link

@arthursalvtr arthursalvtr commented Feb 28, 2019

hi

@mpcen

This comment has been minimized.

Copy link

@mpcen mpcen commented Mar 7, 2019

hi

@tsalmon

This comment has been minimized.

Copy link

@tsalmon tsalmon commented Mar 13, 2019

hi

@mprambadi

This comment has been minimized.

Copy link

@mprambadi mprambadi commented Mar 22, 2019

hi

@BarryCarlyon

This comment has been minimized.

Copy link

@BarryCarlyon BarryCarlyon commented Mar 23, 2019

hi

@LittleMonsterAK

This comment has been minimized.

Copy link

@LittleMonsterAK LittleMonsterAK commented Mar 29, 2019

emmmmm hi

@luiseduardobrito

This comment has been minimized.

Copy link

@luiseduardobrito luiseduardobrito commented Apr 11, 2019

hi

@Artexoid

This comment has been minimized.

Copy link

@Artexoid Artexoid commented Apr 14, 2019

hi

@kuryaki

This comment has been minimized.

Copy link

@kuryaki kuryaki commented Apr 15, 2019

hola

@david1542

This comment has been minimized.

Copy link

@david1542 david1542 commented Apr 18, 2019

hi

@paulolorenzobasilio

This comment has been minimized.

Copy link

@paulolorenzobasilio paulolorenzobasilio commented Apr 25, 2019

hi

@paulolorenzobasilio

This comment has been minimized.

Copy link

@paulolorenzobasilio paulolorenzobasilio commented Apr 25, 2019

hi

@ShekarMania

This comment has been minimized.

Copy link

@ShekarMania ShekarMania commented May 23, 2019

hi

@ohmydevops

This comment has been minimized.

Copy link

@ohmydevops ohmydevops commented Jun 2, 2019

hi guys

@reu

This comment has been minimized.

Copy link
Owner Author

@reu reu commented Jun 3, 2019

What? How come this gist got so popular? Where do you guys found the link? 😕

BTW, hi

@VladMandrik

This comment has been minimized.

Copy link

@VladMandrik VladMandrik commented Jun 7, 2019

hi

@ohmydevops

This comment has been minimized.

Copy link

@ohmydevops ohmydevops commented Jun 8, 2019

What? How come this gist got so popular? Where do you guys found the link? confused

BTW, hi

from google search !! what's up here ?!!!!

@talebkhah

This comment has been minimized.

Copy link

@talebkhah talebkhah commented Jun 8, 2019

hi

@utopiafx

This comment has been minimized.

Copy link

@utopiafx utopiafx commented Jun 9, 2019

Tjena

=> Hi

@binary0102

This comment has been minimized.

Copy link

@binary0102 binary0102 commented Jun 12, 2019

hi

@zloadmin

This comment has been minimized.

Copy link

@zloadmin zloadmin commented Jun 22, 2019

hi

@Mbaqban

This comment has been minimized.

Copy link

@Mbaqban Mbaqban commented Jun 24, 2019

Hi

@mahdisml

This comment has been minimized.

Copy link

@mahdisml mahdisml commented Jun 24, 2019

hello

@iocentos

This comment has been minimized.

Copy link

@iocentos iocentos commented Jun 27, 2019

hi

@lincond

This comment has been minimized.

Copy link

@lincond lincond commented Jul 4, 2019

hi

@Ivikassingh

This comment has been minimized.

Copy link

@Ivikassingh Ivikassingh commented Jul 17, 2019

?

@MichaelMag

This comment has been minimized.

Copy link

@MichaelMag MichaelMag commented Aug 2, 2019

hi

@db2crush

This comment has been minimized.

Copy link

@db2crush db2crush commented Aug 19, 2019

hi

@9bow

This comment has been minimized.

Copy link

@9bow 9bow commented Aug 19, 2019

hi

@Akumzy

This comment has been minimized.

Copy link

@Akumzy Akumzy commented Aug 28, 2019

Hi

@devjin0617

This comment has been minimized.

Copy link

@devjin0617 devjin0617 commented Aug 29, 2019

hi

@jaikanth6

This comment has been minimized.

Copy link

@jaikanth6 jaikanth6 commented Sep 10, 2019

hi

@sublimefengyu

This comment has been minimized.

Copy link

@sublimefengyu sublimefengyu commented Sep 25, 2019

hi..

@Mouse

This comment has been minimized.

Copy link

@Mouse Mouse commented Oct 12, 2019

hi

@yanmendes

This comment has been minimized.

Copy link

@yanmendes yanmendes commented Oct 15, 2019

hi

@szagi3891

This comment has been minimized.

Copy link

@szagi3891 szagi3891 commented Nov 3, 2019

hi

@jose-lpa

This comment has been minimized.

Copy link

@jose-lpa jose-lpa commented Dec 11, 2019

external-content duckduckgo com

@iwano

This comment has been minimized.

Copy link

@iwano iwano commented Dec 13, 2019

hi

@lyuben-todorov

This comment has been minimized.

Copy link

@lyuben-todorov lyuben-todorov commented Dec 18, 2019

asd

@Chickadoo

This comment has been minimized.

Copy link

@Chickadoo Chickadoo commented Dec 24, 2019

hi

@Sharknoon

This comment has been minimized.

Copy link

@Sharknoon Sharknoon commented Jan 15, 2020

hi

@MichaelMag

This comment has been minimized.

Copy link

@MichaelMag MichaelMag commented Jan 16, 2020

Hi Guys! Have a good day!

@Taxellool

This comment has been minimized.

Copy link

@Taxellool Taxellool commented Jan 27, 2020

hi

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jan 30, 2020

hi uwu

@LyoSU

This comment has been minimized.

Copy link

@LyoSU LyoSU commented Jan 30, 2020

hi

@SamixGroup

This comment has been minimized.

Copy link

@SamixGroup SamixGroup commented Jan 30, 2020

Salom

@kerus1024

This comment has been minimized.

Copy link

@kerus1024 kerus1024 commented Jan 31, 2020

hi

@bosej2000

This comment has been minimized.

Copy link

@bosej2000 bosej2000 commented Feb 10, 2020

Thanks for the nice and simple example...:)

@whatjackhasmade

This comment has been minimized.

Copy link

@whatjackhasmade whatjackhasmade commented Feb 13, 2020

hi

@bgk-

This comment has been minimized.

Copy link

@bgk- bgk- commented Feb 13, 2020

hi

@Menci

This comment has been minimized.

Copy link

@Menci Menci commented Feb 17, 2020

hi

@ddemydenko

This comment has been minimized.

Copy link

@ddemydenko ddemydenko commented Feb 19, 2020

hi

@wilensky

This comment has been minimized.

Copy link

@wilensky wilensky commented Mar 13, 2020

hi

@hitslab

This comment has been minimized.

Copy link

@hitslab hitslab commented Apr 8, 2020

hi

@Shankar-khati

This comment has been minimized.

Copy link

@Shankar-khati Shankar-khati commented Apr 26, 2020

hi

@nameerased

This comment has been minimized.

Copy link

@nameerased nameerased commented Apr 26, 2020

hi

@ohmydevops

This comment has been minimized.

Copy link

@ohmydevops ohmydevops commented Apr 26, 2020

I have email notif from here every month!
How strange

@ohmydevops

This comment has been minimized.

Copy link

@ohmydevops ohmydevops commented Apr 26, 2020

anyway, hi

@shininghyunho

This comment has been minimized.

Copy link

@shininghyunho shininghyunho commented May 23, 2020

hi

@ralcorta

This comment has been minimized.

Copy link

@ralcorta ralcorta commented Jun 1, 2020

hi

@FA-QuangLT

This comment has been minimized.

Copy link

@FA-QuangLT FA-QuangLT commented Jun 4, 2020

hi

@Jomsy98

This comment has been minimized.

Copy link

@Jomsy98 Jomsy98 commented Jun 5, 2020

hi

@Pixel3000nerd

This comment has been minimized.

Copy link

@Pixel3000nerd Pixel3000nerd commented Jun 5, 2020

hi

@ismarsantos

This comment has been minimized.

Copy link

@ismarsantos ismarsantos commented Jul 4, 2020

Hi

@ohmydevops

This comment has been minimized.

Copy link

@ohmydevops ohmydevops commented Jul 4, 2020

hi

@phattantran1997

This comment has been minimized.

Copy link

@phattantran1997 phattantran1997 commented Jul 13, 2020

??

@xrip

This comment has been minimized.

Copy link

@xrip xrip commented Jul 28, 2020

hi

@taigah

This comment has been minimized.

Copy link

@taigah taigah commented Aug 5, 2020

hi

@spartanz51

This comment has been minimized.

Copy link

@spartanz51 spartanz51 commented Aug 5, 2020

hi

@ii64

This comment has been minimized.

Copy link

@ii64 ii64 commented Aug 15, 2020

hi

@ahmed-hdeawy

This comment has been minimized.

Copy link

@ahmed-hdeawy