Skip to content

zswang/xqueue

Repository files navigation

xqueue

Emitter at Redis queue

NPM version Build Status Coverage Status

xqueue:emitter:listener:${type}

  • emit(type, data)
SMEMBERS xqueue:emitter:listener:${type}
RPUSHX xqueue:emitter:encoding:${type}:${encoding}
SREM xqueue:emitter:encoding:${type}:${encoding}
  • on(type, encoding, fn)
RPUSH xqueue:emitter:encoding:${type}:${encoding} :nil
EXPIRE xqueue:emitter:encoding:${type}:${encoding} ${expire}
SADD xqueue:emitter:listener:${type} ${encoding}

while (true) {
  LPOP xqueue:emitter:encoding:${type}:${encoding}
  sleep()
}

License

MIT © zswang