Pop message from channel in Redis

v144

I need to publish messages on one machine(setter) in specific channel and get it on other machines(handlers). The problem is that each handler should process unique message.

As I can see in documentation, there is no standard method to pop messages from channel, maybe I try to use it in wrong way?

Here is code of handler:

 import redis

 r=redis.Redis()
 pubsub = r.pubsub()
 pubsub.subscribe('test_channel')
 for item in self.pubsub.listen():
    ...

Here is the code of setter:

import redis

r = redis.Redis()
r.publish('test_channel', 'test message')
Itamar Haber

Pub/Sub doesn't fit this pattern - look into using a List and call blocking pop operations in the handlers instead.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Forwarding message from group or channel

From Dev

Is it possible to create a thread in Rails subscribe to Redis message channel?

From Dev

Pop up a message on the GUI from cron

From Dev

Pop-up message from command line

From Dev

How to broadcast a message from a Phoenix Controller to a Channel?

From Dev

Spring Integration DSL, poll from message channel

From Dev

Sending Message to Discord Channel without message from user

From Dev

How to send Redis message to client side when a new message is published in that channel

From Dev

Pop multiple values from Redis data structure atomically?

From Dev

Is there any way to pop all list items from redis list at once?

From Dev

Dispaly a Pop message from controller to view without refreshing the whole page

From Dev

Dispaly a Pop message from controller to view without refreshing the whole page

From Dev

Spring-xd redis message bus removing headers from the message

From Dev

Telegram Bot How to delete or remove a message or media from a channel or group

From Dev

Get last message from text channel with discord.js

From Dev

Telethon - Save Telegram channel message as a variable from a NewMessage event

From Dev

How to Properly forward a message from another user's channel into a group?

From Dev

Consume from channel only if the number of messages reaches a count or the message is in the channel since a while

From Dev

Yiiframework message pop up

From Dev

discord channel link in message

From Dev

discord channel link in message

From Java

How can I get a list of all the messages in a channel and then pick a random message from that list to send as a message?

From Dev

Redis Pub Sub channel memory

From Dev

Pop up message on mouseover div

From Dev

Pop up message on selectindexchanged in vb

From Dev

Function for pop up message in HTML

From Dev

Pop Up Message On Excel Cell

From Dev

Gmail message sent Pop Up

From Dev

Java. Prevent Jar App from multiple running with pop up message "already running". (using ServerSocket())

Related Related

  1. 1

    Forwarding message from group or channel

  2. 2

    Is it possible to create a thread in Rails subscribe to Redis message channel?

  3. 3

    Pop up a message on the GUI from cron

  4. 4

    Pop-up message from command line

  5. 5

    How to broadcast a message from a Phoenix Controller to a Channel?

  6. 6

    Spring Integration DSL, poll from message channel

  7. 7

    Sending Message to Discord Channel without message from user

  8. 8

    How to send Redis message to client side when a new message is published in that channel

  9. 9

    Pop multiple values from Redis data structure atomically?

  10. 10

    Is there any way to pop all list items from redis list at once?

  11. 11

    Dispaly a Pop message from controller to view without refreshing the whole page

  12. 12

    Dispaly a Pop message from controller to view without refreshing the whole page

  13. 13

    Spring-xd redis message bus removing headers from the message

  14. 14

    Telegram Bot How to delete or remove a message or media from a channel or group

  15. 15

    Get last message from text channel with discord.js

  16. 16

    Telethon - Save Telegram channel message as a variable from a NewMessage event

  17. 17

    How to Properly forward a message from another user's channel into a group?

  18. 18

    Consume from channel only if the number of messages reaches a count or the message is in the channel since a while

  19. 19

    Yiiframework message pop up

  20. 20

    discord channel link in message

  21. 21

    discord channel link in message

  22. 22

    How can I get a list of all the messages in a channel and then pick a random message from that list to send as a message?

  23. 23

    Redis Pub Sub channel memory

  24. 24

    Pop up message on mouseover div

  25. 25

    Pop up message on selectindexchanged in vb

  26. 26

    Function for pop up message in HTML

  27. 27

    Pop Up Message On Excel Cell

  28. 28

    Gmail message sent Pop Up

  29. 29

    Java. Prevent Jar App from multiple running with pop up message "already running". (using ServerSocket())

HotTag

Archive