redis / lettuce

Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
https://lettuce.io
MIT License
5.41k stars 975 forks source link

Add simple interface for custom command invocation for sync/async/reactive APIs #245

Closed mp911de closed 8 years ago

mp911de commented 8 years ago

The Redis Modules concept introduces dynamic Redis commands beyond the core commands. Lettuce 3.x users cannot truly benefit from the modules as lettuce 3.x does not expose an API to dispatch user commands. Lettuce 4.1 provides a dispatch(Command) method on its connection but it requires additional wrapping and there is no synchronous/reactive support. The only other alternative is calling a Lua script but that's not an alternative.

lettuce should expose T dispatch(ProtocolKeyword, CommandOutput<K, V, T>, CommandArgs<K, V>), RedisFuture<T> and <T> Observable<T> methods to invoke custom commands.

Redis modules and @tidwall's tile38 benefit from this change.

mp911de commented 8 years ago

Implemented for 3.5 and 4.2.