Skip to content

Instantly share code, notes, and snippets.

Ben Christensen benjchristensen

View GitHub Profile
View AggregatorServer.java
package lithium;
import org.reactivestreams.Publisher;
//import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
import io.reactivesocket.AbstractReactiveSocket;
import io.reactivesocket.ConnectionSetupPayload;
import io.reactivesocket.Payload;
import io.reactivesocket.ReactiveSocket;
@benjchristensen
benjchristensen / sync-rest-rpc.md
Last active Jan 15, 2018
Regarding synchronous RESTful communication ...
View sync-rest-rpc.md

Response to https://twitter.com/jeffreymaxwell/status/705760483391963136 requiring more than the 77 characters left on Twitter.

DISCLAIMER: The quality of writing and thinking here is aligned with a Twitter conversation, not a blog post, presentation, or book ;-)

Synchronous RESTful communication between Microservices is an anti-pattern ... you seem to being saying that the Netflix architecture (hystrix, eureka, ribbon, ..) is broken ... hmm what would @benjchristensen say?

@benjchristensen
benjchristensen / RxAeronExample.java
Created Jun 1, 2015
Playground for RxJava/ReactiveStreams + Aeron with Backpressure
View RxAeronExample.java
package pubsub;
import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Observable.Operator;
import rx.Scheduler.Worker;
import rx.Subscriber;
import rx.functions.Func1;
View ParallelExecution.java
import java.util.concurrent.atomic.AtomicInteger;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
public class ParallelExecution {
public static void main(String[] args) {
// System.out.println("------------ mergingAsync");
@benjchristensen
benjchristensen / RxJavaPublishZip.java
Created Nov 3, 2014
Example of using Observable.publish, observeOn and zip demonstrating backpressure
View RxJavaPublishZip.java
package reactive_streams_interop;
import java.util.concurrent.atomic.AtomicInteger;
import rx.Observable;
import rx.schedulers.Schedulers;
public class RxJavaPublishZip {
public static void main(String... args) {
View RetryWhenTestsConditional.java
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import rx.Observable;
import rx.Subscriber;
public class RetryWhenTestsConditional {
public static void main(String[] args) {
View RetryWhenTests.java
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Subscriber;
public class RetryWhenTests {
public static void main(String[] args) {
Observable.create((Subscriber<? super String> s) -> {
@benjchristensen
benjchristensen / MulticastColdInfiniteBackpressureExample
Created Aug 4, 2014
Multicasting a cold, infinite Observable and using onBackpressureBuffer/Drop to handle overflow
View MulticastColdInfiniteBackpressureExample
import java.util.concurrent.CountDownLatch;
import rx.Observable;
import rx.observables.ConnectableObservable;
import rx.schedulers.Schedulers;
/**
* This shows how a "reactive pull" compliant "cold" Observable, when multicasted, becomes "hot" and each Subscriber
* must then choose its strategy for overflow.
*/
You can’t perform that action at this time.