publish method

Future<void> publish(
  1. String channel,
  2. String message
)

Publish message to a channel

await redis.publish('chat', 'hello')

Implementation

Future<void> publish(String channel, String message) async {
  if (redisClientType == RedisType.subscriber) {
    throw Exception('cannot subscribe and publish on same connection');
  }
  redisClientType = RedisType.publisher;
  await sendCommand(<String>['PUBLISH', channel, message]);
}