Interface RedisChannel<T>
- Type Parameters:
T- the payload message type
public interface RedisChannel<T>
Strongly typed Redis Pub/Sub message channel.
-
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the codec used to serialize and deserialize messages on this channel.id()Returns the channel identifier.publishAsync(T message) Asynchronously publishes a message to this channel.Subscribes a listener to receive messages from this channel on default virtual/async thread.Subscribes a listener to receive messages from this channel dispatched via an explicit executor.
-
Method Details
-
id
-
codec
RedisCodec<T> codec()Returns the codec used to serialize and deserialize messages on this channel.- Returns:
- message codec
-
publishAsync
Asynchronously publishes a message to this channel.- Parameters:
message- message payload to encode and broadcast- Returns:
- stage completing with the number of Redis clients that received the message
-
subscribe
Subscribes a listener to receive messages from this channel on default virtual/async thread.- Parameters:
listener- message receiver callback- Returns:
- active subscription handle
-
subscribe
Subscribes a listener to receive messages from this channel dispatched via an explicit executor.- Parameters:
listener- message receiver callbackexecutor- executor to dispatch incoming message callbacks- Returns:
- active subscription handle
-