Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive support #68

Closed
mp911de opened this issue Jun 2, 2015 · 7 comments
Closed

Reactive support #68

mp911de opened this issue Jun 2, 2015 · 7 comments
Labels
type: feature A new feature
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Jun 2, 2015

Add another layer between command creation and execution (today a command is created and immediately executed). Reactive commands should be only executed (example from RxJava as soon as call is invoked).

This layer could be located between the command builder and the async connection itself.

@mp911de mp911de added this to the Lettuce 4.0 milestone Jun 2, 2015
@mp911de
Copy link
Collaborator Author

mp911de commented Jun 7, 2015

4.x package: com.lambdaworks.redis.api.rx

New interfaces:

  • BaseRedisReactiveCommands
  • RedisHashReactiveCommands
  • RedisHLLReactiveCommands
  • RedisKeyReactiveCommands
  • RedisListReactiveCommands
  • RedisScriptingReactiveCommands
  • RedisSentinelReactiveCommands
  • RedisServerReactiveCommands
  • RedisSetReactiveCommands
  • RedisSortedSetReactiveCommands
  • RedisStringReactiveCommands
  • RedisTransactionalReactiveCommands

@mp911de
Copy link
Collaborator Author

mp911de commented Jun 15, 2015

Open issues:

Collection results

What about collection result types like lists and sets? Should these be dissolved into particular elements?

Iterables

Sync API:

// sync API
List<String> result = redis.hkeys("...");

Rx API:

// either
Observable<String> result = redis.hkeys("...");

// or
Observable<List<String>> result = redis.hkeys("...");

Maps

Sync API:

// sync API
Map<String, String> result = redis.hmget("...");

Rx API:

// either
Observable<KeyValue<String, String>> result = redis.hmget("...");

// or
Observable<Map<String, String>> result = redis.hmget("...");

PubSub

Provide hot observables for subscription listeners?

Cluster

Provide observable commands also for node-selection commands? (Commands executed on multiple cluster nodes)

@xasx
Copy link

xasx commented Jun 15, 2015

What would be the advantage of emitting List<String> (Iterable!) over simply String?

Grouping could be done using groupBy operator.

@mp911de
Copy link
Collaborator Author

mp911de commented Jun 15, 2015

None.

Rx does not differentiate between one and many elements. Dissolving Iterables and other multi-element containers such as Map into singular values or tuples fit very well into the Rx pattern. This is, however, a change of result types in contrast to other API's within lettuce.

If you approach from pure Rx dissolved elements are welcome, but if you're used to Lists and Maps then you have to shift from collections to reactions on elements.

@mp911de
Copy link
Collaborator Author

mp911de commented Jun 15, 2015

Btw. nice to hear from you @xasx

@mp911de
Copy link
Collaborator Author

mp911de commented Jun 15, 2015

mp911de added a commit that referenced this issue Jun 19, 2015
mp911de added a commit that referenced this issue Jun 19, 2015
* Use completeable commands instead of async commands in rx API
* Provide PubSub observers and reactive PubSub API
* Extend tests
* Extend test timeouts
mp911de added a commit that referenced this issue Jun 19, 2015
@mp911de
Copy link
Collaborator Author

mp911de commented Jun 19, 2015

Observables emit single elements and Maps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants