Skip to content

Commit

Permalink
Provide a stateful redis connection and decouple sync/async API from …
Browse files Browse the repository at this point in the history
…connection resources #75
  • Loading branch information
mp911de committed Jun 9, 2015
1 parent 235461a commit 5bc31f6
Show file tree
Hide file tree
Showing 96 changed files with 3,925 additions and 2,753 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Affected interfaces:
*API Changes*

* readOnly and readWrite changed from `String` return type to `RedisFuture<String>`. The connection state is maintained by the future completion.

* Renamed `RedisPubSubConnection` to `RedisPubSubAsyncConnection` in order to provide a synchronous interface `RedisPubSubConnection`

### New interfaces providing observable commands:

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/lambdaworks/redis/AbstractRedisClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public abstract class AbstractRedisClient {

protected AbstractRedisClient() {
timer = new HashedWheelTimer();
eventLoopGroups = new ConcurrentHashMap<Class<? extends EventLoopGroup>, EventLoopGroup>();
eventLoopGroups = new ConcurrentHashMap<>();
channels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
timer.start();
unit = TimeUnit.SECONDS;
Expand All @@ -86,7 +86,7 @@ public void setDefaultTimeout(long timeout, TimeUnit unit) {
}

@SuppressWarnings("unchecked")
protected <K, V, T extends RedisAsyncConnectionImpl<K, V>> T connectAsyncImpl(final CommandHandler<K, V> handler,
protected <K, V, T extends RedisChannelHandler<K, V>> T connectAsyncImpl(final CommandHandler<K, V> handler,
final T connection, final Supplier<SocketAddress> socketAddressSupplier) {

ConnectionBuilder connectionBuilder = ConnectionBuilder.connectionBuilder();
Expand Down Expand Up @@ -287,7 +287,7 @@ protected int getChannelCount() {
}

protected static <K, V> Object syncHandler(RedisChannelHandler<K, V> connection, Class<?>... interfaceClasses) {
FutureSyncInvocationHandler<K, V> h = new FutureSyncInvocationHandler<K, V>(connection);
FutureSyncInvocationHandler<K, V> h = new FutureSyncInvocationHandler<K, V>(null, null);
return Proxy.newProxyInstance(AbstractRedisClient.class.getClassLoader(), interfaceClasses, h);
}

Expand Down
Loading

0 comments on commit 5bc31f6

Please sign in to comment.