Skip to content

Instantly share code, notes, and snippets.

@devsprint
Created December 22, 2013 05:57
Show Gist options
  • Save devsprint/8078924 to your computer and use it in GitHub Desktop.
Save devsprint/8078924 to your computer and use it in GitHub Desktop.
package net.devsprint.reactive.cassandra;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import rx.Observable;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Session;
public class AvatarService {
private static final String QUERY = "select * avatars";
private static final ExecutorService executorService = Executors
.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
private final Session session;
public AvatarService(Session session) {
this.session = session;
}
Observable<ResultSet> getAvatars() {
return ObservableCassandra
.executeAsync(session, QUERY, executorService);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment