redisPublish: redisPublish

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Publish data to a Redis message channel.

Usage

1

Arguments

channel

The channel name (character).

message

The message (any type, use RAW type for communication with non-R subscribers.

Details

(From the Redis.io documentation): redisSubscribe, redisUnsubscribe and redisPublish implement the Publish/Subscribe messaging paradigm where (citing Wikipedia) senders (publishers) are not programmed to send their messages to specific receivers (subscribers). Rather, published messages are characterized into channels, without knowledge of what (if any) subscribers there may be. Subscribers express interest in one or more channels, and only receive messages that are of interest, without knowledge of what (if any) publishers there are.

Use the Redis function redisUnsubscribe to unsubscribe from one or more channels. Service incoming messanges on the channels with either redisGetResponse or redisMonitorChannels.

Use of any other Redis after redisSubscribe prior to calling redisUnsubscribe will result in an error.

Value

A list conforming to the Redis subscribe response message. Each subscribed channel corresponds to three list elements, the header 'subscribe' followed by the channel name and a count indicating the total number of subscriptions.

Author(s)

B. W. Lewis

References

http://redis.io/commands

See Also

redisSubscribe redisUnsubscribe redisPublish redisGetResponse

redisMonitorChannels

Examples

1
2
3
4
5
## Not run: 
redisConnect()
redisPublish('channel1', charToRaw('A raw charachter data message example'))

## End(Not run)

rredis documentation built on May 2, 2019, 2:02 p.m.