Skip to content

Instantly share code, notes, and snippets.

View benjchristensen's full-sized avatar

Ben Christensen benjchristensen

View GitHub Profile
company CLA
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 January 15, 2018 07:24
Regarding synchronous RESTful communication ...

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 June 1, 2015 22:12
Playground for RxJava/ReactiveStreams + Aeron with Backpressure
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;
@benjchristensen
benjchristensen / ParallelExecution.java
Created February 26, 2015 20:25
ParallelExecution Examples
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 November 3, 2014 16:08
Example of using Observable.publish, observeOn and zip demonstrating backpressure
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) {
@benjchristensen
benjchristensen / RetryWhenTestsConditional.java
Created August 21, 2014 05:06
RetryWhenTestsConditional
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) {
@benjchristensen
benjchristensen / RetryWhenTests.java
Created August 20, 2014 17:24
RetryWhen Example
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 August 4, 2014 17:24
Multicasting a cold, infinite Observable and using onBackpressureBuffer/Drop to handle overflow
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.
*/