0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

redis で 既読/未読 フラグを全員に通知する

Posted at

ユーザーが 10,000人。

ユーザーAが質問を登録したら、
10,000人に "未読あり" フラグを送る。

各ユーザーごとに 未読/既読 とする。

新規投稿した時に全員に未読を通知

既読ユーザーを全員削除して、全員未読ということに。


Redis::del('questionFlag');

セットされてりゃ既読(ユーザーID 1000 は未読or既読?)


Redis::sIsMember('questionFlag',1000);

これが 1 なら 既読。
0 なら 未読。

既読にする(ユーザーID 1000 が既読した)


Redis::sAdd('questionFlag','1000');

こんな感じの流れですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?